Im not sure if this is a bug but I’ve noticed that my EntityQuery.ToEntityArray(Allocator.TempJob); would produce a different order depending on if I have a subScene loaded or not.
For example, here i have PlanetMainScene loaded with auto load scene check

With the following to code
_profilerMarkerGetQueryVertices.Begin();
// Get all
_queryVertices.ResetFilter();
var vtxArray = _queryVertices.ToEntityArray(Allocator.TempJob);
var test = GetComponent<HexagonSphereVertexComponent>(vtxArray[11]).Index;
Debug.Log($"__ {test}");
_profilerMarkerGetQueryVertices.End();
… the output is 11 which is correctl
VS, here I have PlanetManScene unloaded with auto load scene check

… I get the value 14.
The index value is added in a IConvertGameObjectToEntity on an authoring script on a GO inside the PlanetMainScene subScene
int vertCount = (int) hexSphereContainer.vertexCount;
var vertEntities = new NativeArray<Entity>(vertCount, Allocator.Temp);
conversionSystem.CreateAdditionalEntity(this.gameObject, vertEntities);
for (int i = 0; i < vertCount; i++)
dstManager.AddComponentData(vertEntities[i], new HexagonSphereVertexComponent() {Index = i});
Visually you can see the problem

Is this a bug ? or should I never rely on an ToEntityArray order ?