Sam is getting something that he doesn't want.  What is he getting?
headaches being happy then have
headaches
people want to be happy, and "then have" doesn't even make sense. he is getting headaches, because it makes sense and no one wants one.
doesn't want