

Yes, diplomatic immunity can allow even individuals connected to diplomatic officials to kill someone and not face the consequences. As usually diplomatic relations and reputation are far more valuable than the career of some official, one could expect that if a diplomat intentionally kills someone without actual orders from their government, then they'd be given up to be punished. There likely are old historical precedents of military action caused by personal actions of emissaries, but nowadays it would likely result in expelling all diplomats of that country. The expected response from the host country is not against the person, but against the country which is responsible for the actions of their diplomats. This does give an opportunity to use officials with diplomatic immunity for intentionally breaking the law-espionage and assassinations. It doesn't mean that diplomats are allowed to commit crime-it means that their home country is given a "veto vote" if they wish to do so. The intent is rather obvious-it is easy for a government to accuse someone of a crime, and we want diplomats (and opposition politicians-parliamentary immunity in many countries works in a similar way) to be protected from detention because of such accusations. The usual result is that they actually are released due to diplomatic immunity, but afterwards either the country revokes their immunity and they're given to the host country for normal proceedings, or they are judged for the same event back home. There are multiple cases where diplomats have caused deaths, e.g. In practice, that does not prevent them from being judged. In theory, yes, a diplomat can kill someone, refuse to be arrested and return to their host country.
