@ian.withersMKBGW, I also run revit 2022 and 2023 for different projects and the problem is consistent and has been for a year despite updates etc....it is extremely frustrating, but if you follow the directions below to add 'an additional escape key' as a shortcut key it will lessen your frustration immensely. (You can see this in message 13 above).
"Since the only option for me is to close and restart just to have this issue occur minutes or at best hours after restarting, I've added a shortcut key for MD, directly under the escape key for when this occurs (`). The tilde/grave accent key is now equal to the escape key. It's hard to believe Autodesk hasn't found a solution to this, but hopefully this is helpful to others experiencing the same issue. To add a shortcut key, go to the File drop down, select Options, User Interface tab, Keyboard Shortcuts: Customize. From there find and select Modify (MD), type the grave accent key(`) and then click Assign to assign the new shortcut."