For Mojave or later screen recording is built in. shift-command-5 pulls it up. Be aware this is exactly the behavior I'm seeing on Windows 10. On this Mac I'm running the Catalina 10.15 developer beta... but that doesn't seem to matter since the behavior is identical on the windows version. Here's a link to the screen capture. Let me know if you want me to try any other commands or run any code to introspect the environment.
https://neuronsong.com//_/_videos/Screen-Recording-2019-07-15-at--Jul-15--11.38....