Could you maybe try to boil it down to a minimal example that reproduces the error? Also full stacktraces would be helpful (you can make them collapsible).
It is a lot easier for people to help, if they can run the code and figure out themselves where the error is coming from (see some other good suggestions here: Please read: make it easier to help you)