In macOS Mojave, I found that you could make an Automator app that allowed fast user switching by a hot key. The command run was
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID `id -u XXXXXX`
With the Automator App, I could assign a hot key which would then run the command easily without any mouse interaction.
I'm now setting up a Big Sur computer and trying switch to a different user by a hot key. The script above does not work now and gives a no such file error. I'm wondering if there is another way to switch to a userid or a different command to use in order to do this?