Initializing already initialized RID

Godot Version

4.2.1

Question

Hi! I have a game that uses ResourceLoader to load scenes. From time to time, I run into these errors in the logs and some random textures don’t load:

ERROR: Initializing already initialized RID
   at: (./core/templates/rid_owner.h:182)
ERROR: Parameter "mem" is null.
   at: initialize_rid (./core/templates/rid_owner.h:219)
ERROR: Parameter "texture" is null.
   at: _texture_set_data (drivers/gles3/storage/texture_storage.cpp:1224)
ERROR: Parameter "texture" is null.
   at: texture_set_size_override (drivers/gles3/storage/texture_storage.cpp:1114)
ERROR: Parameter "texture" is null.
   at: texture_set_path (drivers/gles3/storage/texture_storage.cpp:1126)
ERROR: Parameter "texture" is null.
   at: texture_set_detect_3d_callback (drivers/gles3/storage/texture_storage.cpp:1140)
ERROR: Parameter "texture" is null.
   at: texture_set_detect_roughness_callback (drivers/gles3/storage/texture_storage.cpp:1159)
ERROR: Parameter "texture" is null.
   at: texture_set_detect_normal_callback (drivers/gles3/storage/texture_storage.cpp:1151)
ERROR: Parameter "texture" is null.
   at: texture_set_path (drivers/gles3/storage/texture_storage.cpp:1126)

I can’t figure out what’s happening, does anybody have a clue?

Thanks a lot!

PS: here you have the game, it sometimes happens in the web version too. Vagonetes Vagarívoles by Jacob Ibáñez