When you import an animation from a video onto a rig with the wrong structure, the animation editor will not create any keyframes, but it will still create some form of ‘ghost data’ that will cause the animation editor to believe that your animation is a certain length. The video below demonstrates the problem. I upload a video that is 144 frames long but no keyframes are created because my rig has the wrong format. The animation is still 144 frames long however. You can still start animating afterwards like normal, but the timeline will incorrectly show your animation as being longer than it actually is.
The only way to shorten the animation at this point that I have found is to insert a keyframe at the end and move it to the left slowly to force the animation editor to recognize that keyframes at the end of the animation were deleted. This is very finicky though as can be seen at the end of the video, so this work-round is incredibly slow.