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.
Update to Sidecar script