What are the practical effects of expelling diplomats?

We left Uganda on the day of the bombing of the Kenyan embassy. My wife knew a number of the people who died in that tragedy. Your post implied to me that it is common for embassy personnel to be confined to their compounds. While it may be true in countries were terrorist activity is high, the majority of embassies are not “fortress” type compounds, despite an unfunded mandate in the 80s to make it so. Security measures are strict for entry at all embassies, for obvious reasons, and some are much harder targets than others. We traveled freely in both Mali and Uganda, despite dangers in some parts of those countries. During the Soviet era, I routinely went out on my own in Moscow, Warsaw, etc. I was followed, of course, but never felt threatened.

There are truly dangerous places in the world, of course, and travel by diplomats is generally in armored vehicles with a security escort. Even so, every effort is made to have personal contact with host government officials.