@GroovyMisfit
You cannot set properties in PowerApps with a formula explicitly. All properties derive their values by formulas in the property itself.
Template Width and Height are not exposed as properties on the gallery that you can add a formula to. This is because those properties derive their values based on multiple factors of the gallery design (i.e. wrap count, padding, etc.)
The TemplateHeight and Width should only be used to reference their values in other formulas.
You can set the TemplateSize property with a formula in it, but it will only impact the width or height of the template depending on the multiple factors of the gallery design.
What is it you are trying to accomplish? You can certainly set a formula in the Height and Width of the gallery itself.
I hope this is helpful for you.