With how far you’re getting, and the fact that the subscriptions endpoint has 0 subscriptions, are you sure the lease time is being set correctly? For example it seems you’re using an env variable, is it set and if so is it greater than 0?
I’m not all that familiar with Python so just suggesting what comes to mind, devs more experienced in the language will be better able to see if there’s any syntax or functionality issues which may be at fault.