Lea's deep dive into dark mode toggles is well worth the read.
I've got strong opinions about this, and Lea nails it with:
Users do not seek out solutions to problems they don’t currently have.
I personally (for my own tools) tend to go further and just have the UI toggle based on the system by default and not even offer the option in the main interfaces (for personal tools I probably won't bother with a toggle at all, for published projects, I'll put the control in a settings page).
If my users are focusing on whether the page is light or dark, then I've definitely done something wrong…