Gonna go with my gut.
Loki was probably rampaging against the WG for what they did to Harald. Indiscriminately so. Kinda like what Rocks was doing but never reaching his fame or notoriety. He probably feels Rocks was validated in going against the WG and continued on.
Still a thorn in the eye of the WG for being a son of Harald and they needed him out of the picture cause he was a threat. Before he gains momentum. Wouldnt be surprised if the WG saw a ghost of Rocks in him, so to speak.
Shanks, no matter how or why, was the one who put an end to it.
Probably can lead to Oda making Shanks' motives more questionable cause "Why would he stop Loki going against the WG and help the WG by restraining him?"
Either way, Shanks became an Emperor as the WG can no longer ignore someone restraining and stopping a beast like him.