As reported on issue Upgrade wxPython to 4.1.1 #11056. After updating to wxPython 4.1.1 NVDA commands no longer work when the NVDA menu (a context menu) or a dialog is open. It appears that the main thread can no longer be woken by the background thread using wx. This can be confirmed by executing some commands, then pressing a key that is just passed through eg left arrow, the commands will now run.
Instead we will need to implement an alternative mechanism to wake the main thread. One potential solution would be to look for an appropriate Windows message to send to signal that there is work to be done.