When the trigger bone is rotated in X Axis, mechanism works in such a way that the Bullet comes out of the gun correctly.
After this I want to animate the Bullet separately from the gun. Right now if I move the gun the bullet moves along with it which creates a problem as I want the movement of the gun to be different than the movement of the bullet.
If I unparent it, it changes its animated position and goes back to the default position. I want to continue the bullets animation after unparenting it for further animation.
Use “Child Of” constraints for the bullet trajectory - you can have many and set the influence to 1 for active and 0 for inactive.
So the trajectory is a Child Of the gun when you fire it and a Child Of a fixed object (like the ground) after you fire it. You can keyframe the influence value - just RMB-Click the box and chose “Insert Keyframe” - change the two influence values over successive frames.
Don’t mess with parenting - like you say it moves things where you don’t want them!
Great! Thanks for the reply @clockmender… tried your suggestion… works with empties… but when I tried it with bones, it again moves unpredictably. Also I cannot link the Rig which is totally made with empties. When I make a Proxy of the Rig totally made with empties, it breaks all the constraints used.