Cant seem to get custom card icon color to work right

It is not a bug. You are using jinja templates in card-mod and it only accepts JavaScript templates.

I can’t teach you javascript, as I barely scrape by using the available documentation, which I do not currently have access to. All I can suggest is that you search the forum and Google for help with JavaScript. Or wait patently and someone else may be able to help.

Also please see point 16 here.