As a student who went through 4 years of undergraduate in computer science, writing allall my exams on paper, I do think there are advantages to a paper exam.
If you need an IDE to tell you the things that are missing, then do you really know your material and syntax?.
Having an environment to test your code over and over isn't really practical for examination purposes or the real world. You should understand the obvious cases and edge cases while writing your solution.
As a lot has already mentioned, CS is not purely coding. From personal experience, I would say my undergrad was 75/25 split between theory/coding. Anyone can code, but learning the theory behind algorithms and best practices is why we are computer scientists.
Continuing on the point above, courses with heavy programming involved usually had a 60/40 split on grading where 60% weight is from code and only 40% from paper exam.
It is a lot easier to ask high level questions such as draw a 2-3-4 Tree, how a certain step in heapify or graph theory looks on paper than on a computer.
To address your point of mistakes being too difficult to detect even with a computer, then it is even harder on paper. No, as a graduate and TA, I can tell you when I'm grading first/second year exams, I can clearly see if they do not understand a certain subject or leaving out edge cases. We do notdo not deduct marks for brace brackets, semi-colons, etc.
In conclusion, I think you are mixing the concept of coding challenges such as ones from Leet Code where it is purely coding based, with a discipline that incorporate a lot of theory and algorithms