It's not inappropriate and it could possibly be beneficial. But I generally wouldn't ask that sort of question. When you're applying for a software developer job, there are many more ways that it can hurt you than help you.
If a decent interviewer knows he or she has concerns about some aspect of your profile, they're going to ask multiple questions about that in the interview. If they're not asking about your grades, for example, they're probably not overly concerned about them. If you happen to get an interviewer that isn't going to follow up on areas of concern, it's very likely that they wouldn't immediately be able to articulate the nature of their concern if you asked.
If the interviewer has a concern that they can articulate but that they haven't asked about, it's unlikely that your explanation is going to sway them. If you happen to get someone that believes, for example, that grades are very important because they signal your innate intelligence or your willingness to do the occasionally arbitrary and boring things that classes require or some other attribute, it is very unlikely that you'll convince them that your grades aren't important. You may have a wonderful argument and that argument might be very persuasive to someone that doesn't think grades are terribly important to begin with. But to the person that thinks grades are important, your argument is almost certain to sound like you're making excuses or that you're trying to argue against their basic premise. That very rarely works out. And that's for arguments that you've rehearsed. If the interviewer's concern is something that you haven't considered, your off-the-cuff argument is even less likely to persuade.
By asking the question, you're putting the interviewer on the spot and encouraging them to think about negatives related to you. Most of the time, multiple people are going to interview you and they're going to compare notes. Even if there is just one interviewer, it's likely that person would want to take some time to reflect before making a judgement. If you ask someone to articulate a concern, there is a good chance that they're going to give that concern a lot more weight when they reflect than they would if it wasn't something that was ever discussed.
In order to truthfully answer this sort of question, an interviewer would often have to disclose information that they shouldn't. In reality, the concerns that I have about one candidate are often influenced by other candidates. But just like I'm not going to discuss your performance with them, I don't want to discuss their performance with you. So I can't say "We just had another applicant that really nailed the discussion on X while your answer was mediocre".
When there are multiple openings, it's also common that you hire complementary skill-sets rather than having a simple objective measure of "best". If I have a few openings in a team that needs skills X, Y, and Z, and if one candidate is really strong in X & Y, I might interview someone that was strong in Z but known to be lacking in X & Y. My biggest concern might well be the lack of X & Y that I knew about before the interview started. And how big a deal that is might depend on whether the candidate with strong X & Y accepts the offer. But if I tell you that your lack of X is a concern when it was obvious from your resume that you didn't have X, you're going to have a rather poor impression of me and the company. And I can't tell you that your weaknesses depends on someone else deciding whether to accept an offer. So I'll likely provide some very generic feedback.