Weird brakes

Ok, then.
When that light comes on its telling you that there is a pressure imbalance between the front and the rear systems.this imbalance is usually thought of as being after the m/c., but it could be before as well.
since you say the m/c is full, im gonna assume there is no leak
since you say it stops halfway decent, ima gonna assume the front system is ok
since you say the pedal gets hard, ima gonna assume theres no air in the system.
since you say its a random condition, its not likely just a simple rear brake adjustment.
since you say the lite can be turned off with a tap on the pedal;This is the tricky one.
I think pressure is remaining in one side of the system after the brake pedal is released and the tap allows the fluid to return, and equalize the pressure to zero. Since it does this with the vehicle stopped, its not gonna be pad knock-back. And not likely a bad front hose. So Ima gonna guess its in the rear brakes, and its a combination of mis-adjusted star adjusters and a bad hose. Now it could just as easily be a sticking P-valve. Or a faulty M/C.
My detecting skills are done. Now its up to you to by process of elimination figure out the rest. I would start with a rear brake adjustment.(no cost and easy).
Gotta go to work, now.

Wow, that's a lot to take in, but extremely helpful. I did just replace the wheel cylinders because the old ones were leaking. I look back there and see what/s happening. Thank you.