Flap retraction is predicated on speeds that are marked on the speed tape. If you start retraction in the higher ranges of the flaps 20 range, are fairly light; you can accelerate through the speeds faster than the flaps can retract.
The wind shear maneuver specifically states not to change configuration.
It appears that there may be more than one contributing causes.
I am not speculating, just listing some.
Slower than normal speed
Heavy aircraft
Power reduced to conserve fuel
Too steep climb angle
pilot error
weather
” If you start retraction in the higher ranges of the flaps 20 range, are fairly light; you can accelerate through the speeds faster than the flaps can retract.”
I don’t quite follow. As to acceleration, are you referencing an increase in power setting or no change in setting?