This sort of thing is pretty common with the API, especially when grabbing data across a wide scope, where you get an error rather than, say, null data.
You can handle it using Python's exception handling https://docs.python.org/3/tutorial/errors.html this is also useful for coping with rate limiting.
For instance (cut/paste from a real script, this sits within a while loop that is part of the rate limit retry logic)...
try:
# get list of devices on network
devices = await aiomeraki.networks.getNetworkDevices(net['id'])
except meraki.AsyncAPIError as e:
if "429 Too Many Requests" in str(e):
time.sleep(10 * attempt)
continue
print(f'mrssids devices Meraki API error: {e}', file=sys.stderr)
return
except Exception as e:
print(f'mrssids devices some other error: {e}', file=sys.stderr)
return
else:
# only process if there's at least one device
if devices:
...