I don't understand the point of prospective employers wasting my time
and their time if they bring me onsite, don't go to any length to find
out about my technical skillset beyond what they can read on my
resume, and then decide to reject me.
In many companies, interviews are performed in a layered manner.
When I hire people, I do a phone screen first. I narrow the list down to a handful of candidates, and then I bring them all onsite.
I am always the first person a candidate talks to once onsite. I talk with the candidate for at least 1/2 hour. If I conclude that the candidate isn't worth a further look, I'll thank them for their time and walk them out at that point. This doesn't happen often, since I've already spoken with them during the phone screen, but it does happen.
If the candidate is worth a further look, I'll then have them talk with others on the team and outside the team that will ask far more technical questions.
While I usually try to conduct all on-site interviews in the same session, some companies separate out the initial sessions and technical sessions.
It's possible that you never reached the sessions in your interviews where the hiring company felt it was important to delve into your technical background in detail.
Without knowing all of the specifics, there's no way to determine why you were rejected. Clearly the hiring company felt like you weren't a good fit - but there are many, many possible reasons. It could be communication ability, the way you talk about yourself, the salary you are seeking, or anything that comes across in person that isn't apparent in your resume.
It's also possible that you were simply caught in an interview process that was bad to begin with - the company is poor at interviewing.
Additionally, some companies believe that the non-technical aspects of the candidate are most important, and don't feel the need to dig in on the technical background as much.
Unfortunately, there's no good way to know ahead of time how the interview will go. You just have to spend time and work hard at the interviews to land a good job.