Strange behavior, but it must be somehow related to the way the original document was saved.
Perhaps it's something as opaque as the exact text encoding: UTF-8, Unicode, a Unicode marker at the start that should not be there — or the reverse, starting with a Unicode marker while poor ID can't handle that.
Perhaps it's the platform-defined line endings: just a Carriage Return (Windows style), just a Line Feed (Mac/Unix style) (I might have mixed them the wrong way around), or even CR/LF pairs (uhm — very old MSDOS style).
Reason it works when re-saved on your computer (what type?) would be your plain text editor is smart enough, on the one hand, to automatically recognized the original file encoding, and on the other hand, to save it the way your ID likes it.
Actually, no way to tell without using a Hex File Viewer on one of the original files; and even then, no way to make ID read the originals … Not without signalling the problem to Adobe and awaiting an update.
(If so: Good luck trying to convince Adobe's poorly Tech Support it is a problem, as their default answer is “User error”, followed by shrugging off any follow-ups you might try with “Problem was solved per our previous mail”. Yeah, been there & done that!)