P1577 is "Brake 2 switch correlation error with brake switch 1" whereas P1576 is "Brake 1 switch correlation error with brake switch 2"
My guess is that if the rear brake switch is faulty we get no signal on A06 when the brakes are off, but signal on A07 when front brake is on, and I'm guessing it reports this as a brake 2 failure (P1577).
I believe P1576 is thrown if there is a voltage always present on A07 when the brakes are off (which should be low), so one error is for A07+, A06+, and the other for A07-, A06-, both of which are invalid combinations (should only ever be either A07+, A06- or A07-, A06+).
Hopefully that makes sense.
So my suggestion is that in his case there is a disconnect either on the Black (B) between the rear brake switch and the ECU, or between the green-blue wires between the two switches.
Easiest test (if you have a multimeter) is to remove the plug from the ECU, and test for continuity between the Yellow wire on the front brake switch, and the pins 6 and 7 in the end of the ECU connector. Pin 6 should normally be conducting (low resistance, e.g. less than about 10Ω), and using either brake should open that circuit.
Pin7 should normally be open circuit, but closed when either brake is activated.
If you don't get that, then you should test the links between A06 and A07 and the rear brake switch.
I don't think your issue is diode related, as that would cause P1576, although I could be wrong.
A word of warning. Do NOT stick the end of a multimeter probe into an ECU connector!!! The sockets in the plugs are small, and sticking a large meter probe in them makes them a loose connection, so they don't connect properly after they are reconnected. Stick a pin into the end of the connector, and test onto that.
We've had two bikes in the last two weeks with stretched ECU sockets where other garages have done this trying to diagnose problems, and we have to remove every connector and bend it closed :/