Why does my blueprint always break when I restart the editor?

I have a class called AAvatar which extends APawn.
I have a blueprint called BP_Avatar which has AAvatar as a parent.

I can compile my code and the blueprint works fine. If I restart the editor the BP_Avatar instance in the level is displayed as a “Bad Blueprint” and the blueprint can’t compile. I have to recompile my code and the blueprint gets fixed, but the position of the blueprint in the level gets reset to (0,0,0).

The blueprint event graph is completely empty. The only blueprint logic is in the Construction Script where I assign a value to two component pointers. The pointers are declared in C++ like this:

and I assign components to those references like this:

Why does this keep breaking? Is there a better way for me to place and configure components in the blueprint and then have a reference to those components in C++?

Thanks!

I had that, I think it was about the Solution Configuration set to Debug Game or something, do you have it set on Development Editor?

I have it on DebugGame Editor because otherwise I don’t get correct debugging symbols when I use the VS debugger. Hopefully this doesn’t mean that if I ever launch the game compiled in a different config it will just wreck my levels with custom blueprints in?

tbh don’t know, never checked that, but I’d guess when you compile with Development Editor, and then with Debug Game it won’t break it, because the biniares will be generated.
It’s not about “breaking blueprints”, it just doesn’t save the biniares, so there’s no AAvatar class in Editor.
You can switch to debug game whenever you need to actually debug.