It’s impolite and weird to say “you’re welcome” when offering a gift for which the recipient did not first express gratitude. It follows “thank you;” it does not precede it.

Try this instead: give a stranger a piece of pre-chewed gum and say “you’re welcome!” Hell, even if it’s not pre-chewed, it’s just presumptuous and rude. You have no idea if they value it or not. They might not even like it.

Even if my barista handed me the coffee I ordered and said “you’re welcome” before I thanked them first, I’d think they’re a little off kilter.