Character's rotation applied after its spawning

Godot Version

v4.4.stable.official.4c311cbee

Question

I have imported a 3D character from MIxamo to test some scenes. Once imported, this character was shown laying on the XZ plane, thus I rotated it 90° around the X axis in its transform tab to have it standing.


Playing the game, it spawns on the game map laying on the floor (XZ plane) for a fraction of a second, then it is rotated those 90° and it behaves as expected.

It looks like the rotation is applied after the spawning and it is not part of the character’s scene.
The same happens if I assign the rotation to the Skeleton3D node instead of the Armature.
Could that be caused by an import mistake or by other reasons?
How could I try to fix this?

You can fix it with an import script.

@tool
extends EditorScenePostImport

func _post_import(scene):
	iterate(scene)
	return scene

func iterate(node):
	if node is Skeleton3D:
		node.rotate_x(deg_to_rad(90.0))
	for child in node.get_children():
		iterate(child)