AVIF supports 10 and 12 bit encoding, which losslessly fits the 9-bit rotation of 8-bit data.
It's also possible to directly encode RGB (channels ordered as GBR) when you set identity matrix coefficients, it's just less efficient.
I've implemented this in my AVIF encoder, so I know what I'm saying.