After a lot of trail and error i made a last resort move and just created a new project and moved the code there. It was the only suitable option. Migration errors were gone and everything worked as expected. Never came to the cause of all the weird errors.