Something your penis made you do, or something you did with your penis that you regret.
I didn't mean to have sex with your best friend, that was a cocksident.
Or, for a kid,
Sorry mom, I didn't mean to pee all over the bathroom floor. It was a cocksident.