ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template

I am using an automation to notify me about current 3d printer status.

During start and print time i found some errors in the log.
I tried to “play with” the default 0- but did not find the correct solution

ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template '{{states('sensor.rechter_3d_drucker_estimated_finish_time',0) | as_timestamp | timestamp_custom('%d.%m.%y %H:%M Uhr',0)}} {{states('sensor.rechter_3d_drucker_estimated_finish_time') | as_timestamp | timestamp_custom('%d.%m.%y %H:%M Uhr')}} {% set done = states('sensor.rechter_3d_drucker_estimated_finish_time',0) | as_datetime | as_local %} {{ done - now().replace(microsecond=0) }} {% set done = states('sensor.rechter_3d_drucker_estimated_finish_time') | as_datetime | as_local %} {{ done - now().replace(microsecond=0) }}' but no default was specified

here are the 2 code lines

Ende: {{states('sensor.rechter_3d_drucker_estimated_finish_time') |
        as_timestamp | timestamp_custom('%d.%m.%y %H:%M Uhr')}} 

        Restdauer: {% set done =
        states('sensor.rechter_3d_drucker_estimated_finish_time') | as_datetime
        | as_local %} {{ done - now().replace(microsecond=0) }}