Using world.createRecord during onLoad lua engine handler (or similar) will cause the queued generated ID to be incorrect
You will get this: onLoad failed: Lua error: Try to override existing record: Generated:0xb
And you will get the same error in game until you pass the generated record.
I've been trying to figure out why this has been happening to me, and I believe it is because my mod generates 3 records anytime the game is loaded, in this engine handler.(It should not do it every time, but it does. That is not the issue here)
So, createRecord should be prevented from being used until it's ready, or something else needs to change.