Must close or hide topmost modal form first (Error 402)

The modal form you are trying to close or hide isn't on top of the z-order. This error has the following cause and solution: