I tried so many times to go in after effects and solve this issue, but I just seem not to be able to. I can play it back in After Effects just fine and also in Premiere Pro, so I have NO idea what I have to do. Can anyone help me please.
It pretty much means what it says - youzr hardware accelerated encoding isn't working correctly. Since you haven't offered any system information or details like actual render settings, contents of your projects and so on we can't advise specifically, but as a start try to render with GPU acceleration disabled even if it takes longer. Also do not render directly to the Desktop but choose a separate directory, ideally on a different drive. Slow storage not keeping up with GPU functions can make things go kaboom just as well. Beyond that the usual applies - check hardware acceleration options everywhere, update your graphics driver, double and triple verify your footage sources, storage space, other relevant tech stuff.