This is a very edge case with an easy workaround but I ran into it using cut on multiple variables in a key.
d <- data.table(x=ordered(rep(1:3,each=5)),y=ordered(rep(c("B","A","C"),5),levels=c("B","A","C")),z=1:15)
d[, mean(z), keyby=.(x,y)] # Ordering is respected
d[, mean(z), keyby=.(I(x), I(y))] # Ordering of the y column is not respected
d[, mean(z), keyby=.(a=I(x), b=I(y))] # Ordering of the y column respected again now that the column names are different.
This is a very edge case with an easy workaround but I ran into it using cut on multiple variables in a key.