Debugging an anonymous function passed to DynamicalSystems

Yes, for that I would advise you to make a Minimal Working Example, that also includes explicitly the error message and the stacktrace, as the code you have pasted is unecessarily extensive and I can’t go through it at the moment.