A headwind component means that you are going slower over the ground.
If the headwind component reduces, your airspeed decreases. To maintain airspeed, you have to accelerate.
You use thrust for acceleration and for climb rate. More acceleration = less climb rate.
That's why you always do two climbs when doing climb performance testing, the second one along the same track as the first one but on the opposite (reciprocal) heading. With those two sets of data, you can eliminate most of the effects of any wind gradients (i e wind changes with altitude) encountered. With just the one climb, you will have no way of deducing whether any perceived climb rate deviations were due to wind or due to the actual performance of the aircraft. Been there, done that, been saved by having the reciprocal run data. The effect of a wind gradient can be very significant.
I thought I was doing good trying to avoid those airport hotels... and look at me now.