Editor crashes on PIE exit after creating constraints in a blueprint

Hello! I wanted to write a small helper method to help me set up a long chain made out of a lot of constraints. I’m using a simple “Editor function” to call the logic, and using normal Spawn Actor of Class nodes. When I click the button, all the objects spawn, but the constraints don’t do anything (after entering PIE). When I stop playing, the editor crashes.

If I click the button with PIE already running, the objects spawn and the constraints get setup correctly, and the editor doesn’t crash on PIE exit. Only when I spawn these in edit more.

Should I be using editor widgets for this instead? Do they have proper functions to setup constraints?