I had happenED to doze off" would be the actual use. or "I happened to doze off" in this case is just means I fell asleep, when perhaps I was supposed to stay more alert! In general it suggests a slightly unexpected turn of events, or a twist of fortune.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.