Much better place is a dedicated thread. Same approach for ANY custom card.
Suggest to remove card-mod from both places & then try step by step.
BTW, in both places a card-mod code is wrong:
– no “card_mod” keyword is specified on a mod-card level;
– no need to use card_mod on a layout-card level - it is not supported here since layout-card does not have ha-card & thus should be wrapped into mod-card (as you did - but forgot to add the mentioned keyword).
Anyway, suggest to use the main thread.