In the past I've been of the opinion that if you carried a rifle it would be silly have it in a handgun caliber. That is, you've got all the inconveniences of a long gun with none of the advantages of a high powered rifle cartridge.
While you're not wrong, you are only looking at part of the matter, and with what I call "modern" eyes.
20th century technology changed the world, and altered priorities hugely, but didn't completely eliminate all the advantages of the 19th century firearms even today.
First thing to consider is the time period and its tech when certain ideas became popular, and why.
What are the "inconvenience" of a long gun, to you?? What were they back then?? What was a "high powered rifle cartridge" in the 1870s? 1880s? 1890s?? and so on? It changed a lot over time.
One of the most frequently brought up points is that commonality between rifle and pistol ammo, was a benefit to people who traveled on horseback, which was the primary way people got around before the internal combustion engine became common. On foot, on horseback, by wagon. carriage or stagecoach were the only ways, where railroads or ships didn't go.
For people working in the outdoors, or even just traveling, everything you needed to survive had to be packed and travel with you. And there were space and weight limits. Not having to carry two different boxes of ammo meant that you could carry that much more food, coffee, or other important supplies.
The pistol caliber repeating carbine or rifle, offered a firepower advantage over the revolver, along with an increase in the easy usable range of the pistol rounds. And, in some designs offered the advantage of being able to reload the rifle while it was still "in action". This could be a useful thing when needing to defend oneself from bad men, or dangerous animals.
Another point to consider is that until the late 1890s, black powder was the only gunpowder, and everything was limited to its maximum speeds. The big powerful rifle rounds of the era used more of it and fired larger heavier slugs than revolver rounds, but not really much faster, other than the difference in barrel lengths allowed. Not at all the difference we have today.
There's a lot more to it, of course, but the commonality of ammo between long guns and handguns was a fairly desirable thing for many people for several decades, and to a lesser extent, still is.
back then, it might take days or weeks of traveling cross country between towns and points of resupply. Carrying only one type of ammo, even if it didn't do every job as well as possible was a more than acceptable trade off for lots of folks.
for about a century now, we've generally had the luxury of motor vehicles to carry what we needed, and wanted. That alone is a huge difference.