I don't know how you're updating it, but you can just update the href of the link tag.
let theme = "dark";
btn.addEventListener("click", () => {
if (theme === "light") {
sheet.href = "https://js.arcgis.com/4.22/esri/themes/dark/main.css";
theme = "dark";
} else if (theme === "dark") {
sheet.href = "https://js.arcgis.com/4.22/esri/themes/light/main.css";
theme = "light";
}
});
https://codepen.io/odoe/pen/qBPaPpR?editors=1000