Your code seems simple and fine --I don’t think it is a code issue. This sounds like hardware. We need a CLEAR, close picture of your set-up. This could be a lot of things. Feels like a reset is floating… I dunno.
Your servo should not be clicking. It sounds like you somehow commanded it to a position beyond its physical limits. Now the little gears inside it may be damaged or have slipped their position. Did you perhaps at some point accidently send a servo or servopos command that was less than 75 or more than 225? All it would take is writing 255 instead of 225 and you can really mess up your servo. (Yeah, I’ll admit it. I’ve done this. The servo was never the same.)
You could elminate other possibities as described by others (something with your wiring, etc.) However, if your servo is making clicking noises, I believe the problem is physically with the servo.
If you are good mechanically, you may be able to open up your servo and determine if this is the case and maybe repair it.