We know that you’ll still be breathing after WB, Kaido and Big Mom captures you. You’re not getting out alive with Shanks on the other hand.
Loki was hurting the Elbaf population, remember what Shanks said about hurting his friends? Kidd ring any bell to you?
So this led me to believe that Loki got deceived and Shanks was informed by Gaban about the incident.
No Yonko kills, let alone Shanks, who's been depicted as the most cavalier of the group.
Kaido enslaves you for his mines, or forces you to join his crew/army.
BM takes a soul tax from you, then lets you go--even if you are a terrorist like Pedro.
WB and Shanks, whose main worry is their territories and the innocents living in them, teach you a lesson to the extent that every other pirate will think twice before attacking anything under their flag.
Shanks has only been shown to use the same amount of strength his own adversary was planning on using in the first place. He didn't kill Kid, nor was he meaning to; his haki slash was as powerful as necessary to neutralize Kid's gun blast.
Barto wasn't killed either, but him disrespecting Shanks' flag had to be publicly and undisputably paid for, even as a friend of Luffy's.
Along the same line is what befell Loki. He was rampaging through the territories befriended by Shanks. Shanks wasn't called upon to "kill" Loki, but to stop him, for the country's good and for Loki's own. Keep in mind that Shanks knows this place and likely knew what Harold was doing as well. We might expect a parallel between Shanks and Loki where both had horrible parents (Garling, Harold), and Shanks might have told Loki that it's not worth throwing his life away for what his father did, but to try instead and make his own path.
I don't expect Loki to have any direct connection to either the Gorosei or the CDs in general, but both him and Shanks have a gripe with Mariejois, only they're going at it in completely different ways--where Shanks awaits he who can use the OP to change the world, Loki wants to destroy the WG and their corrupting system.