shot_instance.rotation = rotation
what you are doing here is setting the rotation of the pellets to the same rotation of the shotgun. The issue here is "rotation" is the local rotation of the object, not the global one.
For example if your shotgun have a 45° rotation, your pellets will have a 90° rotation (45 + 45), because their rotation is relative to the parent. What you need to do is set the rotation to 0 (I assume the node $Shots is a child at the end of the shotgun and pointed at the right direction).
Same with position (setting a local position to a global position makes no sense).
I hope this helps :)