Hi and
to the forum.
It sounds like some further testing is going to be required to try and locate the cause of your problems.
As the error 2 relates to throttle failure, and it only occurs when you apply the brakes, it's possible that a faulty brake switch could be causing this.
Unplug the front brake lever connector and see if the error code still appears when you apply the rear brake.
If it does, plug the front brake connector back in and unplug the rear brake connector and try again.
If it only occurs on one brake and not the other, the brake lever that is causing the error may be faulty.
However, if both brake levers produce the error 2 code with the other one disconnected, then it could be a problem with the controller itself.
Alan