Memory encounter
Hey there, I am currently working on a new, short, low level campaign and I had the idea for what will probably be an encounter or scene towards the end of the campaign (about level 5 to 7). During this encounter the PCs will relive one of the most important moments from their backstory as some kind of malicious memory and they have to find a way to break out of it.
This is supposed to be some kind of trap the BBEG set up to protect their evil lair and it is also supposed to be a way to incorporate the PCs backstory without having to do character focused story arcs, for which there won't be enough time in this campaign.
My question now is, are there any traps, spells, or similar things that already exist that would work for this or at least something that I could expand on? If not, how would you build this idea? What kind of challenges would you implement and how would you run it (combat encounter, victory point subsystem, complex trap, etc)?
I just thought of the idea and I could really use some pointers to make it work. Thank you in advance!