However, there is another common error that springs up among people who recognize this, to wit, the claim that Kant definitely criticizes the Golden Rule itself. It is not so clear that he does. Here is the passage from Groundwork for the Metaphysics of Morals usually adduced to argue that he does:
Let it not be thought that the common "quod tibi non vis fieri, etc." could serve here as the rule or principle. For it is only a deduction from the former, though with several limitations; it cannot be a universal law, for it does not contain the principle of duties to oneself, nor of the duties of benevolence to others (for many a one would gladly consent that others should not benefit him, provided only that he might be excused from showing benevolence to them), nor finally that of duties of strict obligation to one another, for on this principle the criminal might argue against the judge who punishes him, and so on.
None of this implies that the Golden Rule is faulty or false.
(1) It doesn't actually mention the Golden Rule at all; what is mentioned is the what is usually called the Silver Rule, i.e., Do not do unto others as you would not have them do unto you. The negative form and the positive form are not, contrary to common conflation, the same thing, and we shouldn't go assuming that where one is mentioned the other is implied. Kant is certainly not thinking of the Gospels here but of Thomasius (see next point).
(2) Suppose, though, that Kant intended the Golden Rule to be included here -- which admittedly you can do without being all that unreasonable. The criticism can't be that the Rule is faulty as a moral imperative; he explicitly says that it is a deduction from the categorical imperative "though with several limitations". But lots of perfectly good moral principles meet this description: "Do not lie," for instance. The argument here is simply that the Rule cannot fulfill the function of the categorical imperative. The duties that follow are not criticisms of the Rule as a moral principle; they are simply cases it does not explicate the way a categorical imperative would. I suspect that Kant's view is that the principle only describes duties of respect to others; he says it doesn't cover duties to oneself, and it doesn't cover "duties of strict obligation," which description suggests duties of right. It also doesn't cover duties of benevolence to others, which description suggests Kant's duties of love. This leaves duties of respect to others as a class of duties that he does not explicitly deny to the Rule. And this makes sense, actually: duties of respect to others include not harming them or, more broadly, not treating them as mere means. (Incidentally, the conclusion that duties of respect are deliberately not excluded becomes even more plausible if we interpret the comment in such a way as not to imply to the Golden Rule but only to the negative form, which was in fact in common use in certain areas of German moral philosophy in Kant's time, most notably in the work of Thomasius, who proposes it as the first principle of justice in exactly the form Kant quotes.)
(3) Thus the only support for saying that Kant criticizes the Golden Rule is to interpret, as some do, the word translated 'common' above by the word 'banal' or 'trivial'. The phrase "das trivale" could certainly indicate that he thought it was a banality (but then why bother to connect it to the categorical imperative?); but it could also mean that he thought it was a commonplace. The former would imply a criticism of the Rule, but not that it is false: what it suggests is that it would be, as we say, "trivially true".
And thus the claim that Kant criticizes the Golden Rule seems to rest on a single ambiguous word (if we take the negative form not to be important, and thus take the comment to tell us anything about the Golden Rule at all). It's not an unreasonable view, just going on the GMM; but the support for it is actually surprisingly weak, and it should not be stated as definitively true. (Unfortunately I find too many lectures notes online by philosophy professors stating or suggesting otherwise, one going even so far as to attribute to Kant the view that the Golden Rule was a "deeply misguided ethical principle". Given Kant's extreme caution and care whenever it comes to the words of Jesus, it is so utterly implausible to imagine Kant conveying at any point that anything Jesus said is "deeply misguided" that one hardly knows where to begin. One can imagine him arguing that it only applies under certain conditions, or that it has been commonly misinterpreted and giving his own possibly strained interpretation, but Kant would never, ever suggest that Jesus was misguided.)