~/Library/Preferences/Calibre is the correct location for calibre configuration files, I suggest you stop trying to change it. If you really do want to change it, then set the environment variable system wide, which admittedly apple makes almost impossible to do on macOS. Read
https://manual.calibre-ebook.com/cus...ment-variables
As for your template failing, I dont maintain the template language so cant say off the top of my head but your complex template is likely referring to a column that doesnt exist in your calibre library and your simple template has incorrect syntax.