This shouldn't happen. I would suggest trying to reproduce the problem in a minimal compilable example, for example by stripping down your program. Either you'll find the error while simplifying the program or you can post the minimal example here.