I'm really very sorry it took so long to get to your issue. 🙁
I was a bit confused so I moved the gun goal so it wasn't so far from the tip of the gun:
Loading Image
This made it easier to see where the gun should be pointing.
Next I changed how the local bone position is set:
var state = Mouse.GetState();
float worldX = state.X - skeleton.X, worldY = state.Y - skeleton.Y;
float localX, localY;
Gun.Target.Parent.WorldToLocal(worldX, worldY, out localX, out localY);
Gun.Target.X = localX;
Gun.Target.Y = localY;
WorldToLocal is required to transform the coordinates from the skeleton world coordinates to the bone's parent coordinates.
Finally, I found and fix a bug with single bone IK when using a y-up coordinate system or when the skeleton or bones are flipped. Fix is in Git!