1.check if the list view is in editable mode to yes
2.check the permissions for your user is given
The problem is a bit more buggy. If you have a switch in the list view or gallery but no other editable attributes, then still the switch does not work. As soon if you add a checkbox for the same attribute on the page, the switch works…. So I ended up adding a checkbox as well which I hide with css (display: none).