I discovered a weird iOS/Messages bug. If you delete an unread message from the Messages app on one device you’ll still have a badge on other devices with no way to remove it unless you restore the deleted message and mark it as read.