During the Ministry fight in Order of the Phoenix there's an attempt by the kids to lock themselves in.
Sorry about the long passage but it's necessary for context.
He heaved Ron towards a door; they were within a few feet of it when another door across the hall burst open and three Death Eaters sped in, led by Bellatrix Lestrange.
"There they are!" she shrieked.
Stunning Spells shot across the room: Harry smashed his way through the door ahead, flung Ron unceremoniously from him and ducked back to help Neville in with Hermione. They were all over the threshold just in time to slam the door against Bellatrix.
"Colloportus!" shouted Harry, and he heard three bodies slam into the door on the other side.
"It doesn't matter!" said a man's voice. "There are other ways in - WE'VE GOT THEM, THEY'RE HERE!"
Harry spun round; they were back in the Brain Room and, sure enough, there were doors all around the walls. He could hear footsteps in the behind them as more Death Eaters came running to join the first.
"Luna - Neville - help me!"
The three of them tore around the room, sealing the doors as they went; Harry crashed into a table and rolled over the top of it in his haste to reach the next door:
"Colloportus!"
There were footsteps running along behind the doors, every now and then another heavy body would launch itself against one, so it creaked and shuddered; Luna and Neville were bewitching the doors along the opposite wall - then, as Harry reached the very top of the room, he heard Luna cry:
"Collo-aaaaaaaaargh..."
(Order of the Phoenix, Chapter 35, Beyond the Veil).
Let's leave to one side the fact that the Death Eaters running into the doors rather than first trying the handles makes them look like a cartoon pastiche rather than a sadistic sect.
Colloportus is the door-locking charm in Harry Potter. But it has a simple counter-charm: Alohomora. Both of these spells seem to be common knowledge, which means that locked doors are basically pointless in Harry Potter.
Alohomora was such a simple spell that Hermione is able to pull it off in her first year:
Ducking under Peeves they ran for their lives, right to the end of the corridor, where they slammed into a door - and it was locked.
"This is it!" Ron moaned, as they pushed helplessly at the door. "We're done for! This is the end!"
They could hear footsteps, Filch running as fast as he could towards Peeves's shouts.
"Oh, move over," Hermione snarled. She grabbed Harry's wand, tapped the lock and whispered, "Alohomora!"
The lock clicked and the door swung open...
(Philosopher's Stone, Chapter 9, The Midnight Duel).
Frankly, I don't expect any better from Ron. But Voldemort's Death Eaters were meant to be pretty intimidating and sophisticated witches and wizards. It's said that many of them are almost as feared as You-Know-Who himself. Surely a simple door-unlocking spell isn't beyond them? Hermione pulled it off after less than two month's magical education.
Yet the Death Eaters unthinkingly move on the next door. And the next. And the next. Not one of them seems to realise that they could get through any one of these doors with the simplest of spells.
It's especially odd as one of the Death Eaters had used the spell earlier that same evening (thanks to DisturbedNeo for the lead!):
"Colloportus!" gasped Hermione and the door sealed itself with an odd squelching noise.
[...]
They were almost there when Harry heard something large and heavy collide with the door Hermione had charmed shut.
"Stand aside!" said a rough voice. "Alohomora!"
(Order of the Phoenix, Chapter 35, Beyond the Veil).
Why did nobody use Alohomora?
Answers should ideally bear in mind that not all doors from the central lobby led into the Brain Room so by trying a different, random door the Death Eaters had no clue where they'd end up.
"It doesn't matter!" said a man's voice. "There are other ways in..."
, by letting them hear that, it keeps them running and guessing leading them to a point where they can be surrounded easily. We know there's lots of rooms with different functions and entrances, so by keeping the group running it might be possible to get them into a trap just by having some knowledge of the layout of the Department of Mysteries