I am experiencing the same problem on the 2023.06 using thelatest app. Colors are fine when starting up and after a while it switches back to the default colors. I am using a card_mod in badges:
type: custom:badge-card
badges:
- entity: person.xxxxx
name: xxxxx
card_mod:
style: |
@keyframes blinker { 50% { opacity: 0; } }
:host {
{% if is_state('person.xxxxx', 'Home') %}
--label-badge-red: green;
--label-badge-text-color: green;
color: green;
{% else %}
--label-badge-red: red;
--label-badge-text-color: red;
color: red
animation: blinker 4s linear infinite
{% endif %}
}