Chosen Solution

Service history & age unknown. Magic Mouse will stop working for no reason. Batteries are new & tested. Try shaking and tapping and that some times works. I have cleaned battery connection points. Problem is intermittent with no pattern.

Try using a pink pencil eraser on both the moving & the recessed contacts. Often times a thin film of corrosion builds up which blocks the power.