Applies the queued hierarchy change to a world.
This resolves the source entity and optional parent with
World#getEntity. If the parent is the source entity or one of its
descendants, this throws an Error because the requested relationship
would create a cycle. Invalid or stale handles are not converted into a
custom command error; failures from entity lookup or component access are
allowed to propagate.
If the requested relationship already exists, this returns without
changing transforms or hierarchy components. Otherwise, it decomposes each
complete 2D and 3D transform set before changing the relationship. When a
matching new-parent world transform exists, its inverse is applied to the
entity’s world transform first; otherwise the current world transform is
decomposed directly. The old Parent is then removed when present,
and a new one is inserted when parent is defined.