Session crash when opening ssh-remote graphics application

In the local terminal:

ssh -Y myaccount@myremoteserver.com
gedit&

Press windows key to see the application toolbar at the bottom

There are two gedit applications with the description while hovering “gedit (on myremoteserver.com)”.

The two work as intended opening the GUI window.
However, after closing one of them the second one remains hanging in the toolbox!
Clicking on the second one when the first is already closed crashes the local session on the local computer and logouts completely closing all the applications…