Couple of questions about how some things work (State bags and server spawned entities)

Good morning, a few days ago i started developing a script to grow cannabis plants in the most realistic way possible.
The script works perfectly, the entities are spawned on the server side and all the data and time management is handled through the state bags, at first glance everything works perfectly, but after a while strange things start to happen.
It happens that after a while that there are no players inside the server (about 3am) the state bags for some strange reason get empty and don’t keep the data anymore, it’s as if they lose all the data.
Instead concerning the plants themselves i read this documentation on persistent entities but after a while that there are no players (like written before) they also despawn and then i find myself without plants and without state bags.

I wanted to understand as first thing if is possible to solve these problems and as second thing if i can trust the state bags, and then have the data maintained on them or if i have to rewrite my code to make it work 100%