OK, this is my area of expertise.
It is a common misconception that headwinds, tailwinds, have anything to do with an aircraft that is airborne in a stable airmass.
The airplane is like a boat in a sea of air. It matters not what direction that sea of air is moving, the plane is moving within it.
It will not stall or do anything unexpected when turning from downwind to upwind, crosswind, whatever.
The ground has nothing to do with flight, and what direction the wind is flowing over it is irrelavant.
Now let's talk about what does affect an aircraft in flight. Microbursts, huge downdrafts, windshear. Those are all conditions in an unstable or changing airmass. If a plane flies into a microburst on an approach, it will initially experience a headwind, then a downdraft, and then a tailwind. the aircraft cannot accelerate it's mass relative to these changing relative winds, and can get into trouble.
large jets are in the most danger here, because the engines are reduced to very low power settings. It takes precious seconds to "spool up" or spin the engines back up to full power. A propeller driven aircraft can respond much faster in those conditions, but is not immune to the danger.