The same problem occurred to my computer, and I have found the following solution.
Please go to System Preferences > Security & Privacy > Privacy tab > Input Monitoring (i.e. keyboard icon) > Add PsychoPy3 by pressing the plus button (i.e. Allow PsychoPy3 to “monitor input from your keyboard even while using other apps”).
I think the new OS has reset our privacy settings and forbidden Psychtoolbox-based keyboard input as a default. I would be happy if this information is helpful to you.