'Pray I don't alter the deal further'
That doesn't seem like even a particularly tough encounter for a group of PCs like you describe, especially if they have above-average gear.
Without knowing more about your characters, their skill at tactics, their normal approach to things like ambushes, ambushing, traps, knowledge of enemies, enemies having knowledge of them, etc, it's impossible to design an encounter that will defeat them without killing them.
That's the hardest kind of encounter to make, especially if you play with players who think they are kings of the world or saturday morning cartoon heroes, and don't do things like 'run away', or 'hide'.
Generally, if I want the PCs to lose a fight, I put them up against someone who has a vested interest, even if they don't realize it until right that moment, in keeping the PCs alive. Perhaps they need a commando squad, or the recognize that one of the PCs is a Jin'Sath Guild member from the tattoo, and suddenly realizes a cunning plan to use this fact against their enemies somehow, or whatever. Or.. whatever. This can still be hard, but if executed well is believable and good.
In this case though, i'd turn to thievery. Not banditry. I'd have a thief sneak in and steal their gear. A rogue, of decent level. Say 8. With +hide and move silently gear (+10 enhancement bonus), feat to enhance hiding and move silently, good dex and full skill ranks in both and Sleight of Hand. The party is in an inn, gets drunk (even an inn in the wilderness, such things exist) or doesn't get drunk, posts guards or doesn't, casts spells or doesn't - did you know that all Alarm, Symbol etc all count as Magic Traps? Trapfinding says 'Sup, Babe. Rogue comes in and steals their stuff. Badass rogue, describe little details like a scarf worn around the neck or an odd weapon ornamentation, basically outfit this rogue like a cool well-dressed PC. Take 10. This rogue is not rushed or threatened. If one of them spots this, wakes up - good. They can be introduced to the little game I like to call 'chasing someone with Parkour level Tumble and Boots of Speed through the city's rooftops'.
Don't be afraid to drop a Stinking Cloud from a scroll, or a Solid Fog to aid escapes if things go south. Smokesticks + Tanglefoot bags + doubling back, going straight down walls like it ain't no thang, in through a window and then swashbuckle right through someone's living room, using end-tables as projectiles - this is a level 8 rogue, take the chance to just have some damn fun with it. Take joy in describing half the party's magical gear in a sack over the rogue's shoulder during this entire combat. Ready some Errol Flynn style quips to toss at pursuing party members. And escape. Don't get out-thought, don't allow some rules-lawyering bullshit. This rogue is badass, and has a pocket full of tricks and knowledge of the city. Sliding on clotheslines, ducking in front of rumbling wagons of night-soil, if this chase happens, it is epic but ultimately unless the party does really really well the rogue escapes because that is what she is optimized to do.
So, what now?
Well, the party will be keen to get their gear back.
So they will try to find out where this rogue is. Investigation time! Doesn't matter how they do it - they are PCs, they'll find a way. So you set up a bandit lair, preferably in the wilderness. A well-defended natural fort, like a cave or keep on a hilltop. There, you find out that the rogue is number 2 in the group, and there is a leader, and minions, and too many for the party to fight all at once. Then you start introducing Complications.
The bandit group has enemies, which is why they stole a bunch of magical weapons and wands and crap. What these enemies are is up to you - Ogres led by a mighty two-headed Shaman, a Vampire clan in serious decline but with serious fangs, the Elves, a local Lord with a grudge (preferably against the very rogue who stole the party's gear), even a tribe of empowered kobolds who serve a sleeping dragon. So the party has a choice - team up with the bandits to get their gear back, team up with the bandits' enemies to get their gear back, or wait until the groups clash and sneak in and steal back their gear.
You should also make the bandits sympathetic. Making people sympathetic to a group or person who has done them a wrong is a great storytelling technique. Like a do-si-do but with their emotions.
Then, as this is beginning to unfold, you introduce a third thing. A second Complication. The Bandit Leader is in love with the rogue, but she doesn't return his (or he doesn't return her) affections, instead having feelings for a party member on their first mission. There is something... /wrong/ with the bandits' enemies the party decided to befriend, some secret. The Ogres plan to blood-sacrifice the party to their baatezu overlord whose stone idol sits in a sacred cave the PCs aren't allowed near (which you introduce in some manner, say by saying they wander near it and get turned back by armoured ogre guards). The Vampire Lord is insane. The local Lord is a psychopath. The Elves are wearing weird armour that looks super archaic and only one of them talks to you, the rest speaking something that.. isn't Elvish. The kobolds won't talk about it, but something is going on with their dragon master.
So it's a slow threat that will come to a head at the most dramatic moment. By now whatever conflict is occurring has had two fights (two encounters) that the PCs have taken part in. There have been triumphs, and (offscreen) reverses. It's progressing like a tiny war, because that is what it is. That's when you bring in the third complication. This is the wildcard. It doesn't involve a third force unless that third force is overwhelmingly strong and overpowers both existing forces, like a Balor opening a Hellgate nearby and everyone has to RUN, zombie movie style.
The Bandit Leader kills the female rogue in jealous rage, the Vampire Lord takes half the vampires from an important battle, making the vampire that hired the party and is friends with them freak out as they start losing, the PCs realize that they are on the side of evil by some stark, horrible example thrown in their faces (maybe literally, nothing like having a half-eaten child corpse tossed at you to make you re-evaluate your priorities), a ritual is performed in the woods by one of the sides that creates horrible monsters, a vision is received, something happens to shake up the status quo and force the PCs to re-evaluate the decisions they have made to reach this point. They are given an alignment choice, hard path or easy path, evil path or good path. Whichever path is evil, staying with the group they chose or leaving it, or taking a third path, should be made clear. It should also be, or seem to be, the easier option to get their gear back/get extra gear/money. The hard path which is the Good one, should also be made clear that it is both morally more defensible and vastly harder.
Depending on their choice, the Second Complication might not arise. You can use it as either the thing that makes the Hard path Hard, or you can have it happen to punctuate that things aren't simple and even 'Easy' path isn't always safe. Or it could happen regardless, and create a huge epic battle ending scene.
The thing should end, no matter how it plays out, with the bandit group destroyed, with the Rogue (with or sans Bandit Leader and surviving goons) deciding to travel to somewhere a bit safer, saying goodbye to the party that they have somehow become friends with, or, with the Rogue dying on a party member's sword. Stealing goods and forcing the group to chase creates NPC Importance, and Important NPCs need to have satisfactory, emotional endings that make the players feel something - in this case, guilt, revenge, satisfaction, or, vindication, friendliness, achievement (unlocked, Turn Enemy Into Friend).
And better yet, with all these things happening, it's enough to level them a bit, which makes the treasure they have gotten more level appropriate.
Or at worst, charges get used up in the fighting, some of it stolen by (individually fleeing) bandits, or kept by an evil cackling empowered vampire lord who dares the party to 'fight him' now that he has turned most of the bandits into spawn and is even more powerful than before. 'Pray I don't alter the deal further' kind of moment.
In other words, turn it into an adventure. You've got the right idea, your execution is just too simple and likely to either end up as a forgettable encounter or the PCs dead. Anything in the world can be an adventure, if you phrase and design it right. And since adventure is exciting, it's always the optimal way to solve any problems that crop up in-game, from 'too much loot' to 'party interpersonal relationships' to 'party is super bored and just getting drunk all the time in character'.