Lots of cough/cold medicine will make the user drowsy. The typical cough suppressant dextromethorphan can cause drowsiness on it’s own. First generation antihistamines such as doxylamine are also often included in “cough and cold” medicines and can cause significant drowsiness.
Near as I can tell, doxylamine has literally no purpose in these medications except to cause drowsiness. It doesn’t do anything for the cough or for a runny/stuffy nose caused by an infection. You’ll find this combo in NyQuil.
So yes, it’s really a thing, though it probably shouldn’t be (the doxylamine part at least).
Some over the counter cough medicines contain a first-generation antihistamine, which causes drowsiness. Back in the day, some also contained codeine, but I’d hope this is no longer the case.