I updated the Big Sur version of my Sidecar script so that it correctly toggles Sidecar. If Sidecar isn’t connected, running the script will connect it. If it’s connected, running the script will disconnect Sidecar. This was working in the original Catalina version, but for some reason I omitted it when I updated the script for Big Sur.

Since I’ll probably have to update the script for each new macOS version, I moved it to a GitHub repository, where you’ll find the source and downloadable zip files.