Details are details. And answers are in the details.
I suspect that your black spaces at the end of your intended video are due to debris that you have on the Expert workspace Timeline tracks beyond your intended end of video.
(a) Expand the Timeline with the -+ slider above the Timeline.
(b) Press the End key of the computer keyboard and inspect closely what you find at where the Timeline Indicator goes after you press the End key. From what you wrote, it should be going to an area beyond the intended Timeline content. The debris found there needs to be deleted. Some times you will find whole clips that got pushed to the side on any of the tracks. Other times, you might find very thin vertical black lines which are fragments of clips.
(c) You need to repeat the seek and find and delete until the End key results with the Timeline Indicator stopping at the intended end of the video on the Timeline.
If you have exports with this black video end, then move the Timeline Indicator to a spot to cut the selected video and then click on the scissors tab on the stem of the Timeline Indicator (or Shortcut Ctrl+K).
Please review and consider and then we can decide what next. If I have over assumed, then please supply more details of your situation.
A.T.: This was a really helpful post. I must have had some micro bits of code out past the end of my clip, that I couldn't even see, even when zooming in. Some blanket selecting and deleting got rid of them. Thanks, M. Ruggles