Losing a lot of oil by leaving the oil filler cap off could overheat the engine through low oil level, but the oil pressure warning would come in before that occurred surely? The engine doesn't run as well with the cap off though, so sub-optimal running might cause issues, but I doubt it. The head might not have been getting enough oil and cooked the gasket maybe before the block pressure was low enough to trigger the oil alarm??!
I think more likely is your coolant has frozen at some point in the system and has popped/split a connection and is either leaking, causing overheating through air locks and low coolant levels, or its overheated big style and done the head gasket in.
Anyway, don't sweat it for now. Get the coolant refilled and bled properly, then test for leaks. If none are found, its compression test time!