Hell, I can barely "hello world" in languages I've been actively and productively writing for months or even years, without context (i.e. existing code) to draw on and/or tool assistance. I've got a better than 50% offer rate on interviews in an over 15 year long career but in one of the ones I flubbed I blanked on the syntax for invoking methods on an object in the language I knew best, at the time, and wrote some other (more common) invocation syntax instead, which can't have helped. Ask me JS scoping trivia and I guarantee I'll screw it up, despite having written JS and TS as my main language(s) for 3ish years now. Look, I stick to a subset of that language
precisely so that I can ignore that shit. We can just skip the interview and go straight to the rejection if you're gonna do that. Doubly so if you don't tell me you're gonna do that so I can drill on it before hand.
Coworker and manager feedback, and my compensation over the years, say I'm pretty damn good at adding value despite this. I've been considered the "smart one" and the go-to guy for hard or weird problems. But I will struggle to produce something that will even come close to compiling on your whiteboard, in a language I wrote 300 useful lines of yesterday, unless I spend a couple days basically flash-card drilling for your test. Go figure.