It occurs to me that the two stories may in fact be linked. I can imagine that a hundred years ago, some person attached to a British military camp in the Levant or further east – I suppose more likely a British soldier exploring Sufist philosophy, but one can’t exclude a local trying to communicate the concepts to the occupiers – who knew the Rūmī story reinterpreted it for the British troops, changing the gender of the human protagonists and the species of the animal in question.
In both stories, the point of the joke is that the upper-class human should have had greater respect for the knowledge of their underlings, with the result that their attempt to have sex with an animal ends in disaster (embarrassment for the British officer, painful death for the maidservant’s mistress). Rūmī is telling this as part of a wider parable about being adequately prepared for spiritual exertion, though the point of it kind of gets lost in the detail for some readers (including me).
I also speculated about a link between Rūmī and Apuleius, but I don’t see enough parallels to convince me. I suppose we should not exclude two or more people independently inventing stories about sex with donkeys. Anyway, I don’t propose to do any more research on this.
Good luck in advance with The Name Of The Rose