Mesc (any > light amount) always gives headaches at the tail end of the trip (back of the forehead pain), that and some nausea on oral routes are the only downsides. MDMA (only when lots of it) at the near end and maybe the day after gives headaches due to teeth clenching (usually the side that clenched most, a side of the head pain) and eye fluttering (nystagma, back of the eye pain).
I deeply cherish those painful moments, these at least have a reason to be and were my choices. From someone that has lived at least 4 days a month chronic spontaneous headaches since childhood and went through so many doctors just shrugging, choosing my headache is a luxury and really are just tiny mishaps right after to glorious moments.
Tryptamines always clear my headaches if present and the week after. In fact, I got into mushrooms way way back because of the claim it can treat migraines, I can testify it works.