This seems to be alcoholic blackout wherein there is no memory for the behaviour during heavy drinking episodes as the brain is unable to store the memories properly as alcohol interferes with it.
People during alcoholic blackout seem to interact, do complex tasks of which they have no memory later.
Next Steps
If you don't want such a thing to happen again, then avoid heavy & regular drinking