resources.Concat - somehow the content of a slice gets lost in the append

Somehow the content of a slice item gets lost in an append:

I create a slice and depending on being in the correct file I add a slice item. This works fine with the slice ($js) showing all three items. However, the content of the appended item is not added.

If I add $lightbox to the initial slice then resources.Concat works fine so somehow the content of $lightbox gets lost in the append.

{{- $cookie    := resources.Get "js/cookie-consent.js"  }}
{{- $tooltip     := resources.Get "/js/tooltip.js" -}}        
{{- $lightbox   := resources.Get "/js/lightbox.js" -}}

{{- $js := slice $cookie $tooltip -}}

<!-- add lightbox in gallery -->
{{- if eq $.Params.translationKey "gallery" }}
    {{ $js = append $lightbox $js -}}
{{- end }}

{{ $js }}

{{- $js := $js | resources.Concat "js/scripts.js" -}}

hugo v0.100.1+extended
github git@github.com:ourmaninindia/summertimegoa2022.git (develop branch)

I am unable to reproduce the problem when the page’s front matter contains:

translationKey = 'gallery'

Thanks Jim, I was stuggling with another non Hugo issue (upgrading all dependencies like mailgun and AiiY from about two years ago).

No idea what made me waste a lot of time on it last night but we were right in our approach. Will sleep properly tonight, something I skipped yesterday :slightly_smiling_face:

Cheers, Alfred