The stability system looks at a number of factors, like steering angle, vehicle speed, engine speed, braking, acceleration/deceleration (and what rate), gas pedal position, wheel speed sensors, probably a tilt-meter, and probably a few others I'm forgetting...
The brake switch is engaged a lot ...so it's a wear item. Obviously steering angle is also used a lot. They probably plugged in their scanner, saw a SA code, looked at a few other possibilities (hopefully the br switch ..but you never know) and replaced the sensor.
Intermittent issues can be very difficult to uncover ...esp in one shop visit. They can take a lot of time too. Sometimes ya find an issue right away, and that's great. Sometimes not. Some owners spend weeks trying various things to nail down an intermittent electrical problem. There could be several possibilities from failed sensors, corroded connectors, rodent-chewed wire you can't see ..intermittent sensors, who knows? Since most owners don't want to pay a shop $2000-$2800 to spend 1-3 days shop-time digging into 'every' possibility, ya start with the low-hanging fruit and hopefully that gets it. If not, ya move on to the next possibility starting with the most common failures and least expensive parts. I mean, what else can ya do?
Hopefully the next couple moves on your docket will be the answer.