I assume Metronome and Onscreen keyboard display settings can be managed from View menu, but it seems they are always visible…
You can use SHIFT + ESC to close windows like the Metronome, Onscreen Keyboard, side panels etc.
You can also change the hot keys to toggle the display instead of just showing it:
This is my setup, I had the same issue as you and changed the hot keys to toggle the settings, works better for me.
SHIT+ESC doesn’t make Metronome window disappear. It should toggle like the other windows in windows menu to be consistent.