A few years ago I was approached about a new opportunity, and through the course of the interviews I was given a generic fizzbuzz-like coding challenge and I completely bombed it. I got flustered, I got stuck on something trivial, and I ended up running out of time with not much to show for it.
It was in a language that I had been using for 5+ years at that point, using a framework that I had just finished architecting a whole application for, had multiple open-source projects in, and the challenge itself was something that I genuinely felt should have been extremely easy, but I miserably bombed it.
I'm almost positive to them I looked like a giant fraud, and to be honest I felt like one too, but after some thinking I really feel that it was just a bad day combined with being uncomfortable without my editor/tools that I use in my day-to-day job that ended with me getting stuck and failing horribly.
I don't know a perfect solution, but when I was later in a position to hire new devs, I avoided coding challenges because of that experience. I feel that you can get MUCH more insight into a developer by just having them talk about what they have done, go into details about problems that they solved, or how they would approach problem X without any writing of code anywhere except maybe some drawings on a whiteboard if necessary.
Coding Challenges to me test 50% "knowing the syntax and not making mistakes" and 50% "knowing how to solve the problem". We have tools and compilers and linters and syntax highlighting and good editors to solve the former in most cases, it's the latter that I'm looking for in a good developer, so why would I use a test that evaluates both of them equally?