There is no way a wheel bearing could cause a brake failure. The brake failure you described sounds to be brake-fluid pressure related. I would suspect a bleeder valve is barely loose, or a line has a crack in it.
Sometimes, however, just a slight amount of air in a brake fluid line can cause a failure. Pumping the pedal sometimes cycles the air forward enough to regain pressure, but sometimes not.
How to fix it?
As a preventative measure, and if finances allow, replace the brake fluid with new. Over time, temperate changes effect the viscosity of brake fluid. It's best to replace with new fluid at ANY sign of problems.