How to change how long notifications stay on a Mac?
I was able to get this to work as of Catalina (10.15.2)

First, you need to specify -int before the number of seconds parameter:

defaults write com.apple.notificationcenterui bannerTime -int 2


You then need to restart the NotificationCenter process by signing out/rebooting or running:

killall NotificationCenter