There are many things that can cause those faults ranging from brake light bulbs, sensors, low battery, brake switch, earth leads and many other things. Unfortunately the last thing that you try will fix it..

In my case, a dodgy starter motor was the cause of mine. I still get these infrequently which I believe is due to low battery as it tends to occur most when I've had the fridge in the car for a few days.

Unfortunately the fault code readers don't necessarily detect the root of the problem in this case.