When I tried adding keyframes from my second object I got this result:
is there any way I can change specific keyframes to match the animation?
You've pasted an armature animation (series of bones keyframes) after another one. But when it plays, your bones jump from their position at the end of animation 1 to their position at the beginning of animation 2. Like that:
As we can see your bones are not at the good position on the X axis at the beginning of the second part of the animation. The simplest solution to fix this is to use the Graph Editor:
Select the root bone of your armature (the bone that is the parent of the bones hierarchy), if you don't have any, select all the bones. Open the Graph Editor, enable the Only Include Channels Relating to Selected Object (arrow icon) so that you only see the curve of the selected bone(s), lock all the tracks (padlock icon) except the X Location one.
On the horizontal axis you have the timeline in frames, on the vertical axis you have the position of the bone on the X axis. As you can see in my screenshot the X Location curve clearly shows the jump at frame 21 that makes the bone go back far from its position at frame 20.
With B (box select) select all the curve vertices on the right of this frame (frame 21 to 40 in my example), and move down so that it aligns with the previous position (position of frame 20 in my example). Now the armature has moved on the X axis at the good position.