Yes, in my case the static route is defined in the hub. However that shouldn't really matter. You just need to make sure that you're using the correct networkId in the API call... i.e. the network in which the static route was defined.
In the case of a spoke, the hubs are obligatory as well which may be the problem in your case. You're just getting an Error 404 which isn't very helpful indeed.
Here's another test I did for you:
I'd try it out in postman first. Also, copy the body from the GET call to make it easier to generate the correct body for the PUT. Once it's running in postman, translate it into a python script.