The precedence of ($) compared to (>>) is breaking you here. Use parentheses instead.
Additionally, you are working in the X monad so you can get the actual layout (also removing the need for parentheses or precedence-changing tricks like ($)). This should look something like:
An unconditional setLayout means that things like full-screen or multiple layouts selected with (|||) and mod-space will be forcibly reset by this binding.