Start the Mission in Multiplay environment and spawn as player.
Esc and in the console "Execution" section copy the line below.
if ( vehicle player != player ) then {unassignvehicle player; dogetout player;}
In the "Watch" section below place the following in separate lines:
vehicle player != player
assignedVehicle player
Currently they should show "false" and "<NULL-Object>"
Next, take the pilot or a driver position, open the console and watch the changes. Now click on the Local exec button and watch the player dismounting properly.
Next, take a gunner, copilot or passenger position and repeat above actions.
Note that the player gets unassigned from the vehicle (as the second watch line code shows) but does not dismount.
Please let me know if you need any further info.