How a gerund or infinitive is interpreted depends on the verb.
With the verb "recommend" we tend to have
I recommend a bath (noun)
I recommend that you take a bath (that as conjunction)
I recommend you take a bath
I recommend taking a bath (gerund)
I recommend to take a bath (infinitive)
Whereas with "Plan"
I plan a bath
I plan to take a bath (infinitive)
The gerund or the that clause are possible, but less common
I plan taking a bath
I plan that you take a bath.
These are descriptive "rules" in the sense that the "rule" is a summary of actual use, not a prescription. However, language learners may treat these "rules" as prescriptive, if it helps them to progress.
With "plan" the infinitive is the common pattern, with "recommend" it is not. In either case it is not a great idea to use the infinitive in the passive voice. I would rephase
It is recommended that the library be closed... (subjunctive "be")
It is planned that the library will close...
and prefer the active voice to either
We plan to close the library...
(Also boo and hiss to these people who are closing libraries)