My original argument: Kant wrongly rejects outward religious obligations (such as rituals), in Religion within the Realm of Reason Alone, failing to see that (for example) sacramental rituals purport to effect a metaphysical change, and are thus not (in the view of the participant) 'empty'.
Lucy's reply: Kant is here relying on the conclusion of an argument in the First Critique, in which he attempts to show that such metaphysical changes are unknowable. Thus no participant in a sacramental ritual could know that there will be or has been a metaphysical change, and thus there is no justification for the participation. Accordingly, any objection to Kant on this subject should start with the First Critique, and not with the remarks about ritual in the Religion.
On further reflection, I reply: First, the justification I sought for the ritualist was subjective, not objective, and Kant's argument against the knowability of metaphysical facts would not directly impinge on this. (I mean that it is a matter of what the participant believes to be the case, not what actually is the case, which determines the blameworthiness of his action. The ritualist believes he knows the necessary metaphysical facts, and so on.)
Second, Kant is willing to countenance the 'postulation' of three admittedly unknowable metaphysical facts 'as problematical hypotheses', which nevertheless are rightly used as assumptions in deciding what to do: Viz. the existence of God, the freedom of the Will, and the Afterlife. This provides a model for dealing with further metaphysical claims, such as Transubstantiation. Kant thinks that he is licensed to postulate the three claims, and not any others, because they are in different ways absolutely necessary for us to postulate if we are to act rightly and with moral worth. The claim that the reality of Transubstantiation is not something which is necessary for us to postulate, certainly makes sense from Kant's point of view, but is vulnerable to theological objections. Suppose, say, that God revealed that it was after all necessary? ('If you do not eat My Flesh.. you can have no life in you.')
In fact Kant refuses to dismiss the possibility of divine revelation to individuals, but claims it cannot have any moral impact, because it is necessarily not 'universal'. It is this argument which gets the most exercise in the Religion, not the unknowability of metaphysics.
Third, I referred to the Catholic Sacraments as an extreme example of a ritual not being 'empty' and mere outward actions and words - according to their devotees. However there are many religious ritual obligations which do not rest on metaphysical claims such as transubstantiation. Ordinary prayer (praise and thanksgiving), for example, is regarded (in the Tradition) as a obligation upon all rational beings, not contingently upon a revealed command, but as the consequence of the recognition of the existence of God, which can be recognised by arguing from the effects to the cause (so the classical argument goes). Kant rejects such teleological arguments, but he does postulate the existence of God, precisely in order to take account of its practical consequences. He does not regard the existence of God as an indication that we are obliged to engage in prayer, however, and it is not clear why. Again, I suspect that theological assumptions are in play here.
Fourth, Kant actually approves of rituals designed to raise heart and mind to God. We should use 'certain formalities' to make ourselves worthy of divine assistance; these are 'observances which have no intrinsic value but yet serve as a means to the furthering of the moral disposition.' (Part II Section 3) See also the General Observation at the end of this Section: rituals with metaphysical import are allowed a purely ethical role.
This is of great historical interest, because (thought not without precursors) it is the manifesto for 'liberal' modern theology. It is clearly influenced by the (usually incomplete) Protestant rejection of the supernatural in religion, in favour of the ethical. Classical Protestant moves are to say that, for example, saints can be allowed a role not as intercessors in heaven (answering our prayers), but as ethical examples for our imitation; church services do not create a metaphysical reality, but retain a role as exhortations (and usually very tedious ones); etc. etc..
However, despite this, Kant continues to insist that religious observances cannot be moral duties: 'one can recognise its useful influence... and at the same time deny to it, taken as the illusory duty of divine worship, all influence upon the concept of genuine (that is, moral) religion.' Why? Because it is historically developed or revealed, and so is not universal, and genuine moral duties are universal. A familiar argument, but a bad one: why not say that the duty to worship God is universal, but (in Kantian terminology) an imperfect one? Or indeed one that can be perfected, for a certain group, by a divine revelation or a historical church.
More needs to be said about Kant's argument and the best response to it, but it does at least seem to be a moral and theological issue, and not a metaphysical one.