Error compiling bootstrap.scss - Issue with _root.scss
It looks like a bug in SASS compiler itself. Here you have very similar issues:
https://github.com/twbs/bootstrap/issues/24549
https://github.com/sass/sass/issues/2383
Try this:
1: :root {
2: // Custom variable values only support SassScript inside `#{}`.
3: @each $color, $value in $colors {
4: --color-#{$color}: #{$value};
5: }
6:
7: @each $color, $value in $theme-colors {
8: --color-#{$color}: #{$value};
9: }