Initially I tried to perform this using the python request module and experienced an issue while trying to work through the response.links (for next page) so I spun up a python venv to test this on the python meraki sdk and experienced similar results.
I eventually put some debug print to stderr in the rest_session.py library file, that let me figure out the causes and a fix.
Combination of things: the actual API endpoint wasn't quite following the documented pagination rules, but also the Meraki Python library had some loop breaking logic that didn't work in this situation.
At the moment there is a support case open on the endpoint, I also reported on Github but so far the library has not been fixed, I just add my own patch to handle the problem.
It is not quite the same as the problem you have but my guess is it's similar.