Saying "thank you" on reflex and actually feeling grateful aren't the same event, and decades of gratitude research suggest that the benefits come less from simply saying the words than from genuinely noticing and appreciating something good, which means the automatic version and the deliberate version may be doing two different jobs.
Politeness and genuine gratitude activate different neural pathways, which means your automatic "thank you" might be doing the opposite job of the kind that actually improves your wellbeing.