You have to throw the boomerang in a way that it will hit the button on it's way back. Every boomerang will go through blocks when it returns.