Problems with Sun.Sun since moving to

I just moved my installation to (rpi3) from hassbian and all seems to be fine except for one of my template sensors. This has worked previously with no issues, but doesn’t seem to be displaying data any longer. Here is the configuration along with the source component and the outputs.

Any ideas? THANKS!

- platform: template
      friendly_name: 'Sunrise'
      value_template: "{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom('%-I:%M %P') }}"
      icon_template: mdi:weather-sunset-up
      friendly_name: 'Sunset'
      value_template: "{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom('%-I:%M %P') }}"
      icon_template: mdi:weather-sunset-down

This is what I use for a non setup, so it may not make any difference…

- platform: template
      friendly_name: 'Next Sunrise'
      value_template: '{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom("%D %I:%M %P") }}'
- platform: template
      friendly_name: 'Next Sunset'
      value_template: '{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom("%D %I:%M %P") }}'

I can confirm this. Pasting your template in the templates tool on normal hass in venv on ubuntu 16.04 works, on shows nothing.
If you use some other format string like ‘%H:%M’, it works.

That is so strange. Without the format, it’s blank. With the current format, it’s blank. With just the %H%M, all works great. Adding a %P to that also breaks it - as does leaving off the %P and replacing the hours with a %-I or %I.

Awesome catch. Thanks for the assist!