Problem with opening part in new window via macro

Hello,

There is the command accessible through right mouse click 'Open in New Window'. Unfortunately, it is not present in the Customize/Commands/All Commands list, so I'm not able to create a shortcut icon for it.

Therefore I decided to create a workaround and wrote this absolutely basic macro (module in catvba library):
Sub CATmain()
CATIA.StartCommand "Open in New Window"
End Sub

It works fine when I run it through Tools/Macro/Macros menu. But when I create a shortcut which is supposed to run this macro via some toolbar, it freezes my Catia by somehow entering an infinite loop instead of opening the selected part/parts in new window. Did anyone had similar problem or can try to replicate this issue? Any ideas how to mitigate it? I've verified the same behavior in Catia v5-6 R2020, R2019, R2018 and R2016. What is even more strange, this macro was working perfectly fine until recently, I would say around month ago, when it started looping infinitely without any apparent reason...