Why do my bathroom outlets only work if I plug in a particular device?
It sounds like there is a high-resistance connection somewhere that is limiting the amount of current that can be delivered. Your cordless toothbrush is probably pulling very little current. You can confirm this by plugging in and turning on a higher current load (which doesn’t work) and at the same time checking the voltage at another outlet. I expect it will drop to a low voltage. 

You can test to see if it is the breaker, if you are comfortable working with the panel cover off. While the load is plugged in, check the voltage on the black or red wire coming out of the breaker. You can probably test the voltage at the screw on the breaker. 

Most likely you have a poor splice of other connection somewhere. Do the outlets use back-stabs for the wires? If so, one of them may not be making a good connection. I’d suggest redoing all of the outlets using the side screws instead. 

One more thing. When you see the low voltage from hot to neutral, also check voltage neutral to ground. If this rises, the problem is in the neutral wire, not the hot wire.