Insert the masquerade form after rendering because it doesn't work through admin menu's caching system. If the form is cached it's not possible to switch users using Masquerade.