I have found the following ritual for collecting herbs in the Kamaratna-tantra, which is a Hindu tantra from the 14th century (although its contents may be derived from older source).
Are there more sources describing rituals/mantras for collecting herbs?
To collect medicinal plants a man should fast over night, and in the following morning, after offering salutations to Mahadeva, should approach the plant with due respect and utter the mantra (No. 1)—
“Ye betāl, pishāsa, rākshas, and creeping animals that live in the plant, go away at the command of Shiva.”
Then the plant should be saluted by uttering the mantra (No. 2)—
‘Oh mother, thou hast they birth in the nectar, and thou incresest strength and vitality. Let me drive away the sins and diseases.’
After this the plant should be dug with a flawless weapon while uttering the mantra (No. 3)—
‘I dig thee with the same sacred hand with which Brahmā, Bhrigu, Indra and Varuna dug you.’
After this prayer, mantra (No. 4) should be recited—
‘Oh mother, what is my fault? May the divine life depart from this plant, so that I may be saced from the sin of uprooting and cutting it. Go thou to heaven doing good to me.’
After this prayer, the medicinal plant should be dug on a Sunday in Paushyā lunar mansion and in the Rabi Yoga while uttering the eight-lettered mantra (No. 5). The plant should then be cut after reciting the six-lettered mantra. (No. 6)