I remember one interview I went for where I completely bombed on some of the technical questions the panel asked me. I walked out of there so downbeat. I ended up getting the job. Perhaps I had the advantage of having done a couple of days per week there prior as part of a managed service contract with the place I was working for at the time - maybe they saw the way I worked and liked the way I fit in with the team, I dunno. I ended up working there for years and became really good mates with the Tech Lead who was asking the techncial questions in the interview, but I never asked him why they went with me - I didn't want to bring it up as I was still embarrassed!Sometimes, I've actually answered a question by admitting flat out that I don't know. I actually got that job and the employer told me that they really liked the fact that someone was honest enough to admit that instead of fibbing. It's a real fine line.
I think @sensesmaybenumbed hits on the point that there will likely never be someone who is an absolute perfect fit for a role - but life is a learning experience in every way and that's the message you need to convey to the interviewer - that you're eager to learn and ovecome your shortcomings.