I figured out what is going on, sort of. download_content in QByteArray seems to contains ^M (MSDOS newline) in some parts of the file when written to dump. When written to the desired file, it does not have those. Later on, in compareDownload the QBytearray does ontain the "^M" characters and the written file does not, therefore their bytes are different by x*^M. I currently do not understand why ^M is there and then not when written and I do not know how to remove from the QByteArray in the compareDownload function. Also during my tests to figure this out, QByteArray new_contents saves to file with ^M once I added that in there to compare with QByteArray file_byte_array.
Edit: Actually the regular file that becomes file_byte_array does have the ^M, but the QByteArray that reads the file lacks it.