Get in vehicle as gunner.
Endure that you are no in your optics.
Hold your zoom button (Rmb in default) and continue to hold.
Press your button to go into optics.
Release zoom button.
At this point you will be able to switch out of optics, but unable to zoom out until disconnecting from the server and reconnecting.