The XT M8000 RD won't take a 51t cog, regardless of the cage length. There are aftermarket gizmos like the Wolftooth Goatlink that might work.
You will likely need to either switch to the Deore M5100 RD mentioned above, or you can also use a Shimano 12 speed RD, as those are designed to handle that size cog and have the same pull ratios as the 11 sp RDs.
I am using a 12 speed XT RD with an XT 11 SP shifter and an 11sp 11-51t Sunrace Cassette on a standard HD freehub (which is what I assume you have).