I think neither the bundled bubblewrap nor the Ubuntu 24.04 bubblewrap works properly under Docker with the default options ... Yes, I've just tested that by asking Codex to "Test that bubblewrap is working properly" and then "Test again" after apt-get install bubblewrap.
EDIT: So the solution is to run "codex --dangerously-bypass-approvals-and-sandbox" in a Docker container?