This is intended as a heads-up (unless anyone can explain more) in case anyone else has a similar problem. I think it points to a wxWidgets problem.
I had a user who was having trouble running a wxpython application that had been installed some time back and had been running just fine until at some point running the same command was suddenly getting the screen access error ("…please run with framework build…") even though they were running with an app that had worked before. It is not obvious what had changed on the computer.
Installing a fresh miniforge python & wx4.1 in a separate environment and then using the new pythonw still failed on a call to wx.App().
The message here: How to run wxPython with the python.org installer on macOS 12.4 (Monterey) (leading to How to run wxPython with the python.org installer on macOS 12.4 (Monterey) - Stack Overflow) gave the clue that wxWidgets method IsDisplayAvailable
is failing. Not sure why that is the case, but commenting it from core.py provided a clumsy but satisfactory workaround.