this line shifts left every time the bar appears
this line does not move at all
The jump when a scrollbar arrives
CaveatThere is only a gutter to reserve where the browser draws a classic scrollbar that takes space. On overlay scrollbars, the default on macOS and on every phone, the property is a no-op and the demo above only shows a difference because it styles ::-webkit-scrollbar and so opts out of them. For the page itself the property belongs on html, not on body.
FallbackUnsupported browsers ignore the declaration and you are back to the shift you started with, which is a nudge rather than a break. The old fix, overflow-y: scroll on html, reserves the same width permanently and still works everywhere; the cost is a dead scrollbar track on every page too short to need one.
<html> <!-- the scroll container, not body -->
html { scrollbar-gutter: stable; }
/* symmetrical, so centred content stays centred */
.pane { scrollbar-gutter: stable both-edges; }