It is formulaic, agreed, but sometimes, that is the point.
And I used to think it stiff, and stilted, and false, - all the stuff you have written - until the funerals, respectively, of each of my own parents, when I realised - for the first time, of the necessity for - and the value of - this formula.
This is because it gives people - who are struck dumb by feelings of embarrassment, awkwardness, inadequacy, people who aren't used to attending funerals in societies that attempt to deny death, stumbling through a (public) ceremony lacking words to express what it is that they wish to say in a tone that suggests conviction - a script that they can follow in this context, even if it seems somewhat stilted.