Up to and directly above the first ridge you were benefitting from an upslope wind.
After crossing the spur ridge you dumped yourself into the nasty stuff downwind of the ridge crest.
Perhaps you could have stayed on the good side of the spur ridge and turned back on course when over lower ground.
Talk to the local glider pilots.
Overflying the cumulus can also work if you know the clouds thin out over lower ground.