Sorry for the long wait. I literally forgot about the mods. But, to be sincere, I wasn't able to find the problem. I couldn't find a problem. In addition, if you are able to find it, I will post the solution =)
Read the source. You should probably loop through all forces and do it for any new forces that gets added later with https://lua-api.factorio.com/latest/events.html#on_force_created and maybe also some other events.
In case someone uses the mod for multiplayer, so not just 1 team gets the queue.