The error message claims that scheduler.step() was called more than the specified 42*50=2100 times.
I don’t see the epoch loop in your code snippet, but assume it’s somehow integrated in the manager?
For debugging purposes you could add a counter and print its accumulated value for each scheduler.step() call.