Adapting the lwc-recipes modal recipe, calling the @api hide() method from a parent component threw "Cannot read property 'classList' of null" whenever the modal had a footer slot. The reporter's diagnosis: after hide() sets showModal to false, the template rerenders, the footer slot content changes, and the slotchange handler handleSlotFooterChange runs when this.template.querySelector('footer') already returns null, so classList.remove crashes. The crash only showed in some environments because it depends on rerender timing after the slot content changes.