I was able to reproduce the issue again, even with my fix.
And this time unmounting the /dev of the chroot is not even possible after the build. So I ran fuser and based on the result it looks like at some point the real /dev of my machine was mounted.
% sudo fuser -v -m /home/paul/scratch/edubuntu-pi-arm64/chroot/dev/ USER PID ACCESS COMMAND
/home/paul/scratch/edubuntu-pi-arm64/chroot/dev: root kernel swap /dev/dm-1 root kernel mount /dev root 110 .rc.. kdevtmpfs root 6159 f.... lxd paul 6996 ....m pulseaudio paul 7125 ....m Xorg paul 7270 ....m gsd-xsettings paul 7274 ....m gsd-power paul 7285 ....m gsd-color paul 7288 ....m gnome-flashback paul 7315 ....m gsd-keyboard paul 7316 ....m gsd-wacom paul 7319 ....m gsd-media-keys paul 7691 ....m picom paul 7937 ....m mattermost-desk paul 7954 ....m xdg-desktop-por paul 10083 ....m Vivaldi-Gpu messagebus 490522 F.... dbus-daemon messagebus 490530 F.... gvfsd messagebus 490539 F.... gvfsd-fuse messagebus 490551 F.... dconf-service
I was able to reproduce the issue again, even with my fix.
And this time unmounting the /dev of the chroot is not even possible after the build. So I ran fuser and based on the result it looks like at some point the real /dev of my machine was mounted.
% sudo fuser -v -m /home/paul/ scratch/ edubuntu- pi-arm64/ chroot/ dev/
USER PID ACCESS COMMAND scratch/ edubuntu- pi-arm64/ chroot/ dev:
root kernel swap /dev/dm-1
root kernel mount /dev
root 110 .rc.. kdevtmpfs
root 6159 f.... lxd
paul 6996 ....m pulseaudio
paul 7125 ....m Xorg
paul 7270 ....m gsd-xsettings
paul 7274 ....m gsd-power
paul 7285 ....m gsd-color
paul 7288 ....m gnome-flashback
paul 7315 ....m gsd-keyboard
paul 7316 ....m gsd-wacom
paul 7319 ....m gsd-media-keys
paul 7691 ....m picom
paul 7937 ....m mattermost-desk
paul 7954 ....m xdg-desktop-por
paul 10083 ....m Vivaldi-Gpu
messagebus 490522 F.... dbus-daemon
messagebus 490530 F.... gvfsd
messagebus 490539 F.... gvfsd-fuse
messagebus 490551 F.... dconf-service
/home/paul/
I do not understand how this is possible.