WinBox window closes automatically when accessing router

Yep, but if you have access with webfig, you can export the configuration and post it for review, instructions (for Winbox, but Webfig is similar enough), here:

The most likely cause (on the Mikrotik side) is something "wrong" in firewall rules or a mis-categorization of interfaces in interface list together with the set for mac-winbox.

BEFORE that, can you try with Winbox from another computer?
It could be also something in the OS you are running on your PC.