The devastating twist of Le Trou occurs in its final minutes. Just as the four remaining inmates (Geo having decided to stay behind) are about to make their final move to escape through a manhole into the street, they use their periscope to check the corridor one last time. They see it swarming with guards, who are silently waiting for them. The plan has been foiled at the last possible second.
It is revealed that Claude Gaspard is the one who betrayed them. Earlier, he had been unexpectedly summoned to the warden's office. The warden informed him that his wife was dropping the charges of attempted murder, meaning his release was imminent. This news, which should have been joyous, becomes the catalyst for betrayal. The warden likely offered him a deal or assurance of his release in exchange for information. When Gaspard returns to the cell, he claims he still wants to go through with the escape, but his demeanor has changed. The others, particularly Manu, are suspicious, but they ultimately decide to trust him one last time.
The hidden meaning, underscored by the entire film's exploration of trust, is the inherent clash between the prisoners' code of solidarity and individual self-preservation. Gaspard, the outsider, was never fully one of them, and when presented with an easy way out, he reverted to protecting his own interests. The final line, "Poor Gaspard," spoken by Roland as Gaspard is led away to a separate cell, is not an expression of anger but of pity. Roland understands that while the four of them will remain physically imprisoned, Gaspard has sentenced himself to a lifetime of guilt and dishonor, a far worse prison. The betrayal re-contextualizes the entire film, turning a story about a shared struggle for freedom into a tragic parable about human weakness.