I have a hard time believing the beer totally turned to foam... Maybe the poppet didn't seat and it leaked out there. I had a sour beer aging with low pressure that started leaking a little bit over several days (only a cup or so), but if it were at higher pressure, it would probably have leaked more. Only reason I knew was there were a surprisingly high number of fruit flies around.
Or if you had a disconnect on, the disconnect or connection to it were loose and the beer leaked out. I have had a defective picnic tap that wouldn't seal. Didn't realize until the keg leaked into the freezer in almost entirety.
I would check the keg and all connections you used.