I have a main .tex file containing preamble and \input commands to call different chapters in my thesis.
Before some of these \input commands, I place \part{Part Title} to divide my thesis into parts. This works without problems and results in a Part page with the "Part Title" located ...
Okay, it does not work with deleting the ToC file in my real document. I reproduced this error in the minimal example by including a chapter where I call \addtocontents (see line 150 in the new Thesis_main_error)