Am I wrong to think that a reason discs have become popular is due to difficulties braking on a carbon rim?
I would say yes.
When carbon rims first appeared , it was tricky and a number went with alu braking surfaces. However now "they" have developed different brake pad compounds for carbon rims, its no longer an issue.
Its also takes out the rim wear issue too, as the carbon specific blocks wear quite quickly, but the carbon rims barely wear at all, so you don't get the concave rims / worn brake surface issue you could get on high mileage alu rims (albeit easily solved with handbuilts - lace a new rim on).
My best bike has rim brakes and carbon rims, all works fine, stopping power is good. My winter bike has hydro discs which are deffo superior in the proper wet weather, but in the dry / just the odd shower kind of weather the carbon rim brakes are just as good.
at the end of the day braking performance is dictated mainly by the grip of the very small contact patch of the tyre to the road surface.
However the big brand manufacturers don't want the extra cost of developing rim brake and disc brake frames, so the majority of new road bikes now come with disc brakes and thru axles, because that is what the pro peloton races, and that is what they think sells best.
Rim braked road bikes are become a minority niche on new bikes. No coincidence that Shimano's new 105 Di2 is Disc brake only.