I have encounterd the same effect while trying to make a datapack which sorts the players by distance to a given entity.
It showcases the same effect. (My report also proves that the reversing also happens when calling functions)Tanks for your time!
A minor bug, not gamebreaking in any way I know of.
I have encounterd the same effect while trying to make a datapack which sorts the players by distance to a given entity.