Create UObject in StartupModule()

Most likely because it gets garbage collected as engine don’t see it referenced anywhere (aka used anywhere) as you not using UPROPERTY() and treats it as trash, as you can’t use those in module class or any other unrefected classes you should use TWeakObjectPtr so you wont get invalid pointer like you have now

Read this how to keep your UObject alive (thru it might be little bit outdated):