One thing that you lose if you replace checkboxes with toggle switches, at least on webpages, is the third 'indeterminate' state that JavaScript offers. https://css-tricks.com/indeterminate-checkboxes/
I've never understood what that state is supposed to indicate. It only makes sense when the checkbox has nested checkboxes underneath and an indeterminate state only indicates that the user has some of the children selected. But as a user I'd never be able to select this indeterminate state, since, by definition, it is indeterminate. for such scenarios, I'm not sure what is good design.