Getting air in the lines somehow

Or when the master returns from far travel air is getting sucked in around the master cylinder plunger.
Try hitting the brakes hard, then let the pedal up slowly instead of just taking your foot off.
If it doesn't do it when you let up slowly that is what it is. (not a good seal on the master piston)

You can try this without actually driving the car.