It looks like the brakes switch S9/1 would be the problem. That is the switch on the pedal.
The BAS has a BAS release switch A7/7s1 that detremines when the plunger is unloaded in the brake booster (brakes off) and a diapram travel sensor A7/7b1 that determines how fast the brakes are applied.
The first code looks to implicate the S9/1 and the second is saying that the BAS switches conflict with the S9/1 input. It could be the BAS value that is wrong but since there is a separate code for the switch in particular and because its cheap and a common failure, I would go there. BTW the S9/1 is an input to the ESP module and comparisons are made in one controller or the other via the CAN.
Bosch Master, ASE Master, L1
33 years MB technician