Help with time difference (again)

Hello
I have an input text with end of action in string format
i search how to show remaining time
the problem:
in template:
the conversion from string to unix time is good
the conversion back is good
idem for now()
so the difference should be good…no
the template:

{% if ( states('input_text.man_duree_string_2023_ex')|as_timestamp > now()|as_timestamp ) %}
{{"actif"}}
fin d action en unix:
{{( states('input_text.man_duree_string_2023_ex')|as_timestamp)}}
fin d action en unix puis en format:
{{( states('input_text.man_duree_string_2023_ex')|as_timestamp)|timestamp_custom("%d %H:%M" , True)}}
now en unix:
{{( now()|as_timestamp)}}
now en unix puis en format:
{{( now()|as_timestamp)|timestamp_custom("%d %H:%M" , True)}}
fin en unix - now en unix
{{( states('input_text.man_duree_string_2023_ex')|as_timestamp - now()|as_timestamp -59*60*0 -24*60*60*0)|int}}
fin en unix - now en unix puis en format
{{(( states('input_text.man_duree_string_2023_ex')|as_timestamp - now()|as_timestamp -59*60*0 -24*60*60*0)|int)|timestamp_custom("%d %H:%M" , True)}}
{%else%}
{{"fini"}}
{%endif%}

gives me:

actif
fin d action en unix:
1699643520.0
fin d action en unix puis en format:
10 20:12
now en unix:
1699643400.591039
now en unix puis en format:
10 20:10 < ok it is 2 min action
fin en unix - now en unix
119 < I guess it is ok 2 min = 120 seconds
fin en unix - now en unix puis en format
01 01:01 < WRONG should be 00 00:01 or 00 00:02

what i am doing wrong ?

What are you actually trying to do?

What does your input look like?

What is the expected output?

Why are you subtracting 0 twice?

@Didgeridrew

I am just Trying to show time remaining between now() and states(‘input_text.man_duree_string_2023_ex’)
The 60x60x0 parts are my first tries to adjust the result (the x0 is a fast way to erase the effect of correction)
for minutes delay ,result was good when substract 1 hour : 60*60
But it fails with longer delay (hours or days)
Thank for your help

@Didgeridrew
I manage to get what i want in pure jinja:

{% if ( states('input_text.man_duree_string_2023_ex')|as_timestamp > now()|as_timestamp ) %}
  {{"Fin dans:"}}
  {%-set tt=( states('input_text.man_duree_string_2023_ex')|as_timestamp - now()|as_timestamp -59*60*0 -24*60*60*0)|int %}
  {%-set ttj = (tt / 86400)|int-%}
  {%set tt= tt- (ttj*86400)-%}
  {%set tth = (tt / 3600)|int-%}
  {%set tt= tt- (tth*3600)-%}
  {%set ttm = (tt / 60)|int-%}
  {%set tt= tt- (tth*60)-%}
  {%set tts = (tt / 60)|int-%}
  {%if ttj>0%}
    {{ttj}} Jour(s) {{tth}} Heure(s) {{ttm}} Minute(s) {{tts}} Seconde(s)
  {%elif tth>0%}
    {{tth}} Heure(s) {{ttm}} Minute(s) {{tts}} Seconde(s)
  {%else%}
    {{ttm}} Minute(s) {{tts}} Seconde(s)
  {%endif%}
{%else%}
  {{"Fini"}}
{%endif%}

I am frustated not to know if there is a built-in function to avoid this basic computing.
I believe there must be a simpler way ?