Why does this not work? (dynamic resource bundling)

The error you got is because of a bug I introduced in 0.49.1 (or 0.49, not sure) and fixed in 0.49.2.

That said, I would suggest that you … scratch .Scratch and simply to something ala:

{{ $css := resources.Get "sass/theme.scss" | toCSS | slice }}
{{ range .Site.Data.assets.scss }}
$css = $css | append (resources.Get .) }}
{{ end }}
{{ $style :=  $css | resources.Concat "assets/css/style.css" | fingerprint }}

With no guarantee that I spelled the above correct …