This is a bit beyond my skills as I don't python much and don't AWS or MQTT at all, so perhaps someone else can get you to the answer much quicker than I can.
However, looking at the error you posted, it looks like you are getting a timeout while trying to publish.
Perhaps you need to increase the timeout duration?
A bit of google searching reveals that there are a couple of timeout settings that can be tweaked (.configureConnectDisconnectTimeout() and .configureMQTTOperationTimeout()), perhaps you need to look into those?
There's also this open issue on the aws iot python sdk (which I assume you are using): Recommendation on handling publishTimeoutException #211