Just an addendum (but we already reached this conclusion on discord, mostly for other readers): if you put your code from Prefbab settlement xml into sandbox's main_map xscene, it works, so the TL;DR of the issue is: the game isn't loading the xml on the prefabs folder