I didn’t take the time to try to fully understand your template, but one thing that seems obviously wrong is the comments. That’s not how to add comments in a template. It should be like this:
{% if now().strftime("%M") | int == 0 %} {# zero minutes #}
In addition to what Phil said, you can make this template a bit more readable with a singular result as the output instead of replicating the same json dictionary multiple times. This reduces the chance for errors. You can also just get the hours or minutes without needing to ‘convert’ the value with strftime. Lastly, you can get rid of the nested if statements. Just look at hour and minute separetly.
{% set sessionId = trigger.event.data._intent.sessionId %}
{% set t = now() %}
{% if t.minute == 0 %}
{% set minutes = 'hundred' %}
{% elif t.minute < 10 %}
{% set minutes = 'zero ' ~ t.minute %}
{% else %}
{% set minutes = t.minute %}
{% endif %}
{% if t.hour < 10 %}
{% set hours = 'zero ' ~ t.hour %}
{% else %}
{% set hours = t.hour %}
{% endif %}
{"sessionId": "{{ sessionId }}", "text": "The time is {{ hours }} {{ minutes }}" }
You can also utilize in line if statements or the immediate if function. It works like the @if macro in excel
iff( statement, true-output, false-output)
{% set sessionId = trigger.event.data._intent.sessionId %}
{% set t = now() %}
{% if t.minute == 0 %}
{% set minutes = 'hundred' %}
{% else %}
{% set minutes = iif(t.minute < 10, 'zero ', '') ~ t.minute %}
{% endif %}
{% set hours = iif(t.hour < 10, 'zero ', '') ~ t.hour %}
{"sessionId": "{{ sessionId}}", "text": "The time is {{ hours }} {{ minutes }}" }
Lastly, you can take a completely different route that’s super short for the sake of being short.
{% set sessionId = trigger.event.data._intent.sessionId %}
{% set a, b, c, d = now().strftime("%H%M") %}
{% set minutes = 'hundred' if c ~ d == '00' else c.replace('0', 'zero ') ~ d %}
{% set hours = a.replace('0', 'zero ') ~ b %}
{"sessionId": "{{ sessionId }}", "text": "The time is {{ hours }} {{ minutes }}" }
The service call you posted above appears to be the same challenge you posted here where I solved it with a three-line template (from your original fourteen-line template).
What requirements changed so that you chose to forego it in favor of using the nineteen-line template you posted above?