A block registering its view script in block.json, and a leftover wp_enqueue_scripts callback doing the same thing under a different handle.
// block.json
{ "viewScript": "file:./view.js" }
// → handle: turkerdev-slider-view-script
// functions.php, from 2021, never removed
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_script( 'slider', get_theme_file_uri( 'js/slider.js' ) );
} );
// two files, two handles, one initialising the same
// element twice — which is why the carousel double-stepped.
The symptom was a carousel advancing two slides per click, which is what two initialisations of the same component look like and does not read as a duplicate script. viewScript in block.json also only loads on pages where the block is present, which the manual enqueue did not — so removing the old one both fixed the bug and stopped shipping the file site-wide.