Usually you get a warning if the object is not in layout right?
No, that's a different thing - there must be an instance of the object somewhere in the entire project to be able to create it.
Separately, there must be an instance on the layout for it to be pre-loaded. If you create an object that is not pre-loaded, there is no warning, it just silently loads it on the spot, which often janks.
As for the other issue, I'm afraid my telepathic debugging has its limits and I don't know. Try making a minimal repro.