getAncestors returns collection sorted by OrderColumn but this should first be sorted by Depth I believe.
Because the order of the node is depth depending. Currently the root node is last in the collection.
But this should be the first item in the collection.
public function newMaterializedPathQuery(): Builder
{
return $this->newQuery()
->orderBy($this->getQualifiedDepthColumnName())
->orderBy($this->getQualifiedOrderColumnName());
}