This is a known issue on Debian 12.
Related:
- Debian 12.1 upstream networking breaks in SSH sessions after running any Docker app
- Lost Network Connection After Docker Install - Fresh Debian Install
GitHub issues:
- Failure to create correct firewall rules under Debian 12 ("Bookworm") · Issue #46147 · moby/moby · GitHub
- Native support for nftables · Issue #1472 · docker/for-linux · GitHub
I didn’t go through all of the solutions in the comments, but there are multiple suggestions.