

Sounds to me like the failure wasn’t yours, but the interviewer’s; you came prepared for questions relevant to the role, and they went all out-of-pocket on you.
Like if you show up for a tech job and they start going “paint me a word picture… tell me about your personal philosophy…”
Like you said, if they just googled some BS to ask you, or followed the corp-approved “starting questions”, that’s their fault.
Maybe you could reach out to them (or HR?)and go “hey, I was surprised by some of the interview questions, but I really do think I’m a strong match - can we get together and come to an understanding on the relevance of those questions?”
(I didn’t know, I have never coded python at a professional level - but I will take your word for it!)