OAuth Periodically Failing

A while back I made a thing, documented here, which uses some software running on a local host to push events to a SmartApp in the ST cloud using OAuth. Everything is working for me, but I’m trying to help @aliby get it working and they are running into some OAuth problems. About 10% of the time, the cloud server responds with:

 {"error":true,"type":"AccessDenied","message":"This request is not authorized by the specified access token"} 

The other 90% of the time the events go through properly. My software uses the following invocation (with a real token/endpoint) to send the data:

curl -H 'Authorization: Bearer 12345678-1234-1234-1234-1234567890ab' -H 'Content-Type: application/json' -X PUT -d '@/var/www/html/deviceState.json' https://graph.api.smartthings.com:443/api/smartapps/installations/12345678-1234-1234-1234-1234567890ab/event

Any OAuth wizards out there that might have an idea why this would only work most of the time?