I had a sticky magnetic contact switch, that would allow the AC to run nonstop and it only had half of last summer on it.
Next time it happens.
Use a well insulated screwdriver to pull the contact to the off position while it's running when it shouldn't be running.
If the contact stays in the off position? You have a bad switch. If it instantly snaps back into the ON position? You probably have a bad thermostat that is sending a ghost signal to the contact switch.
Part should look something like this
https://www.google.com/search?q=ac+c...3074108-115Z63
Things I've learned from Bugs over the years.