The Cloak of Displacement reads (emphasis mine):
While you wear this cloak, it projects an Illusion that makes you appear to be standing in a place near your actual location, causing any creature to have disadvantage on Attack rolls against you. If you take damage, the property ceases to function until the start of your next turn. This property is suppressed while you are Incapacitated, Restrained, or otherwise unable to move.
Notably, the Cloak of Displacement only works against attack rolls (meaning that the cloak will have no effect against spells or other things which do not use attack rolls - you can read more here).
My question pertains to the functionality of the Cloak of Displacement in the following scenario:
Consider a character that is wearing a Cloak of Displacement, who is teleported to a different location. Awaiting them at the new location is a Rogue who is hidden, and has readied a sneak attack against the creature who is teleported into the space in front of them. How would this interaction play out?
On the one hand, RAW, I would assume that the Rogue would still have disadvantage, since the cloak is projecting an illusion (in-game, perhaps the rogue sees 2 different manifestations of the character upon being teleported, and would therefore still have disadvantage).
On the other hand, since the Rogue was readied, and since they would be attacking immediately upon the character being teleported in front of them, perhaps there was no time for the Cloak to take effect, meaning the Rogue could take their sneak attack as normal.
I could easily see a similar situation happening without teleporting (eg the rogue is hidden behind a door with a readied action to sneak attack the first person who enters, and that person happens to be wearing a Cloak of Displacement).
Thus how does the Cloak of Displacement interact with surprise or hidden attacks? Ideally answers would reference RAW or RAI, though I'd also be interested in how DMs would deal with this situation.