Unfortunately this is the way badges are supposed to work now in oreo : the badge is tied to the notification, if you dismiss the notification, so is the badge (if you are using the Samsung experience launcher, if you use another launcher it may not behave in the same way, some application may also behave differently)