Riker was definitely DeSoto's XO on the Hood
But was he? All the talk in "Encounter at Farpoint" about Riker stopping DeSoto from beaming down is sort of circumstantial, because Picard only brings the "XO contradicts his CO" thing into the discussion later on, and might technically be solely talking about the upcoming arrangement between himself and Riker. The original contradicting of the CO might have involved Riker in the Security Chief role, or even, say, in the role of an Operations Chief acting out of his place. That is, at no point is it outright stated that Riker was DeSoto's XO.
It is the likeliest explanation for the dialogue, though (not to mention being its obvious intent).