When somebody helps me out, I say to their manager, "when you get a chance please tell them I'm grateful for their good work."
Was it their distinguished expertise that made it possible for them to help me? Was it a spirit of collegiality? From my perspective, I don't care when I thank them. They did me a favor, I'm happy, I'm grateful.
Give and Take is a book by Adam Grant on this part of the workplace. https://www.worldcat.org/title/give-and-take-the-revolutiona...