This feels a little hacky, but maybe it will work, depending on how predictable the size of your tree is:
MATCH path=(root:Node { i: 3 })<-[:parent*0..]-(node:Node)
WITH nodes(path)[-1] as n,[x IN nodes(path)| x.i] AS o
ORDER BY o[0], coalesce(o[1], -1), coalesce(o[2], -1), coalesce(o[3], -1) // and so forth
RETURN n
Where the -1 in the coalesce is definitely lower than any possible values in the .i
property.
Here's another idea using the properties of string comparison to our advantage:
MATCH path=(root:Node { i: 3 })<-[:parent*0..]-(node:Node)
WITH nodes(path)[-1] AS n,[x IN nodes(path)| x.i] AS o,
reduce(maxLen=0, p IN root<-[:parent*]-()|CASE WHEN maxLen < length(p)
THEN length(p)
ELSE maxLen END ) AS maxLen
ORDER BY reduce(acc='', x IN range(0,maxLen)|acc+coalesce(str(o[x]), ''))
RETURN n,reduce(acc='', x IN range(0,maxLen)|acc+coalesce(str(o[x]), ''))
You can either get the max path length as shown, or just make maxLen a really high number.