Next time it fails to engage, try lifting up on the brake pedal with your toe and try again. Sometimes these brake switches are on the cusp of being out of adjustment.
The brake pedal switch is actually 3 switches in one, so your brake lights may be working fine.
The cruise control brake switch portion is normally closed. It is interrupted (opens) when you push the pedal.
The rear brake lamp switch portion is normally open. It closes when you push the pedal to light the lights.
The PCM brake 'sense' switch portion is normally open. It provides a path to ground when you press the pedal (closes) so that the PCM knows when you are braking.
Modern brake pedal switches aren't really adustable. Once a replacement is installed, it sets to the correct depth with a pedal application and it is complete.
If it is not a brake switch problem, drive the car with a scan tool or AlfaOBD to watch the switch states on the display. It should show each steering wheel button push and the brake pedal push. The dealer scan tool (WiTech2), will show the reason for the last cruise disengagement. This is very useful for intermittent issues.
View attachment 59229
View attachment 59230