Mine did that very same thing for a while before it went out.
Then the brake light started coming on occasionally, and going off again.
then one day the brakes went out and the brake light came on, permanently.
I hope that you have better luck than I did.