These are the little touches it's so easy to miss in Oda's writing. It's not really foreshadowing to anything, but look at Chopper talking to Law here, at the end of Wano when they're about to set sail and separate:
"See you around, Traf!"
To Chopper, the Heart Pirates aren't just allies, they're his friends, and he gave Bepo that medicine, and warned him about it not working possibly, because he cared about his friends and wanted the Heart Pirates to be safe.
I know Post Time Skip Chopper became a merch icon sadly, but, still, these moments with him really are sweet and kind, and remind me Chopper really just loves using medicine to help people.