So after a while I managed to get my hands back on modding and the bug still exists :)
If you inherit your object in config.cpp from another object and not from it's "base" object - your new object will have glitched lifetime. It will be set to zero and will not change even with scripts. So your new object will be deleted asap.
It was working fine but 3-4 months ago this bug showed up.