I had a similar problem with a stuck CMD key. Fortunately (and unnusually for my setups), I had a guest access enabled that doesn't require a password. Using that I was able to enable Sticky Keys (Accessibility | Keyboard | Sticky Keys, and enabled it at login which helped bypass the issue). This might address your issue unless it is actually the caps lock key that is at fault.
That said, today I found a more permanent solution that likely will. I've been using sticky keys for many months, but it is a hassle, and today the CMD key began a more agressive engagement.
I found numerous recommendations for Karabiner-Elements, a free keyboard re-mapper for MacOS. Not only was I able to make the left CMD do nothing, I was able to write that to the default keyboard so that it is disabled at startup. Hopefully, you can make use of this for your situation.