Take my opinion for what you paid for it -
Some (most?)will be offended by cash. They think you are saying they're being nice to you for a tip. Even if you didn't mean it that way. Money is impersonal too. If you want to say 'thank you for the extra effort', going to the trouble of buying something just for them is noticed.
Many people often feel uncomfortable accepting something for doing their job. Especially the nice ones. Easier to accept a seemingly less valuable gift like cookies or cofffee.