When Dean says, "You just bought into the biggest hoax in history," it's a strange dialogue, given the recent context.
DEAN: This mess... all the messes. It turns out that we're just hamsters running in a wheel our whole lives. What do we have to show for it, huh? Tell me you don't feel conned. God's been lying to you, Cas, forever. You bought into the biggest scam in history.
"You bought into it," Dean says. Which... no.
Cas may have prayed to Chuck, he may have been a loyal soldier to Chuck for eons, but he's the one that turned away from Chuck's recent machinations. He's the one that challenged Chuck and walked away from him, even from Sam and Dean.
What are Dean's words about? Well. They're about everything. But they're about Dean's shame. His despair.
I think (2) things. These words are directed at Cas because Dean's "putting on Cas what he can't take," but Dean's saying these words indirectly to himself.
It's Dean who just bought into Chuck's scam at the worst possible moment. (This was a momentary thing, but to Dean, this feels huge. A betrayal and a self-betrayal. A crisis of faith and a crisis of faith.) And Cas, kindly, does not call him on this. He's sympathetic. So sympathetic.
CASTIEL: You don't think I'm angry? After what Chuck did? After what he took from me? He killed Jack. But that doesn't mean it was all a lie.
DEAN: Really?
CASTIEL: Chuck is all-knowing. He knew the truth, he... he just kept it to himself.
DEAN: Well, now that his cover's blown, everything that we've done is for what? Nothing?
CASTIEL: Even if we didn't know that all of the challenges that we face were born of Chuck's machinations, how would we describe it all? We'd call it "life". Because that's precisely what life is. It's an obstacle course, and maybe Chuck designed the obstacles, but we ran our own race. We made our own moves. And mostly, we did well with that.
DEAN: Did we?
And this is Dean's insecurities playing up again. Did Dean do well here? DID he?
He bought into Chuck's machinations and played right into his hands. Dean was spiraling, hurt, and he felt he had to do the "right thing" to save the world from Jack.
But the pain point is: Dean feels like the world's biggest dupe right now, and it's easier to blame Cas. If you're really squinting at the circumstances and considering Dean's propensity for stories and reading, it's even easy to be suspicious of Cas.
Mary's dead. Jack's dead. They didn't do "mostly well" with this obstacle course, with this game of Mouse Trap.
In Dean's mind, they have resoundingly lost.
Cas is trying to offer support, gently, saying "We're real." Because he went through this moment waaay back in season 4 with Heaven. Back then, it was Dean who snapped Cas out of it and helped him wrestle with Heaven's authority and what's really real:
DEAN: Destiny? Don't give me that "holy" crap. Destiny, God's plan... It's all a bunch of lies, you poor, stupid son of a bitch! It's just a way for your bosses to keep me and keep you in line! You know what's real? People, families -- that's real. And you're gonna watch them all burn?
...
'Cause I'll take the pain and the guilt. I'll even take Sam as is. ...This is simple, Cas! No more crap about being a good soldier. There is a right and there is a wrong here, and you know it.
...
Look at me! (DEAN grabs CASTIEL’s shoulder and turns CASTIEL back to face him) You know it! You were gonna help me once, weren't you? You were gonna warn me about all this...Help me -- now. Please.
They're almost the same scene.
Cas can't bring up that families are real because their family just died—a whole big freakin' chunk of it, and it's too painful. So, instead of "families are real," we get "we're real." But Cas is effectively calling back Dean's own words.
Absolutely, it is mirroring 4x22.
Dean has become season 4 Cas, conflicted, horrified with himself, not knowing what's real, and seeming to make all the wrong moves. This is the soldier's burden, now unsure of the cause (and "we're real" IS the through-line for every soldier-coded character from vintage SPN all the way to terminal-season- Eileen.)
Dean charges Cas with being "the thing that goes wrong" because (1) he's rightfully suspicious of all things Chuck-adjacent and (2) Dean feels like he's the thing going wrong in big ways right now. That everything he does is for nothing.
Dean "choked" at the worst possibly time with AU Michael, back during The Spear in 14x09, and it devastated him. AU Michael said as much:
Michael Dean: To break him, to crush and disappoint him so completely that, this time, he'll be nice and quiet for a change -- buried. And he is. He's gone.
For Dean, that moment has a clear path to THIS moment. And this is where he finds himself now, choking again with regards to Chuck.
EDIT: I like this, because it's a little-discussed complicating factor in the trial separation, but it's a huge part of it, too: that Dean chose Chuck's plan, even for a moment.
It's a guilt Dean carries but will not easily admit, and for Cas, it's just painful. Painful because Chuck should have been a loved one to trust, but he was a piece of shit with ill intentions... and painful because Dean couldn't see it immediately.
BUT they did show amazing resilience, even in the face of all of it. We have to remember that, even after Mary died, even after Dean said Cas was dead to him, they stayed together, in the same house, speaking to one another.
When Mary was burning on the pyre, Cas was ready to run and try to take Dean in his arms (Sam stopped him). Chuck had to try to interfere directly to engineer a separation. Even after Jack, they were sticking like glue as they ran from the graveyard, then saying "thank you" and "welcome" to one another when dealing with the zombies. At a time when they should've been oil and water, they were trying to find a way to be around one another and leech much-needed support from the other. It was Belphagor that drove the biggest wedge. Then The levee broke after the burning of Jack's body and the loss of Rowena.
(And even after that levee broke, they swam to one another later in the season. As The Trap shows us, found new purpose together right up until Claire Novak died.)