I don't have one where I can lay my hands on it right now, but I'm betting that when a Happ 49-way is in the furthest up/right position, all of the optical sensors on the joystick are unblocked, or maybe all blocked- either way, I'll also bet that when that happens, the joystiick is sending no data to the GP49. So when you unplug your parallel cable, the GP49 suddenly gets no data, and thinks your stick is in the up/right position.
As for a fix, try unplugging and then re-plugging the GP49s after you disconnect the parallel cable for the 49-way panel. That should re-boot the GP49s with no stick attached. I don't know if they will reboot in the centered position or not, but if it works, then you could rig a "reset button" inside the cp for the GP49s, just a button that would cut the power on the USB lines. Whenever you switch panels, press the button for a second, and when you let it up, power would be restored, and the GP49s would reboot.
Alternately, you could disable analog controls in MAME whenever you pull the 49-way panel.
Or ??