notification – gsettings command not affecting settings

I was trying to write a script that would enable and disable Do Not Disturb. As such, I was using the gsettings command to enable and disable notifications

I used these two commands:

gsettings set org.gnome.desktop.notifications show-banners true
gsettings set org.gnome.desktop.notifications show-banners false

However, when actually executing these commands and testing them with notify-send, they did not change anything at all. When I edited the flags manually using dconf-editor, however, the notifications were successfully enabled and disabled. Why isn’t gsettings working, and is there an alternative?

I’m on Ubuntu 20.04.

Thanks!