Updated configuration, but docker container now won't start

I’ve had Home Assistant running in Docker on a RPi4 for the past month untouched - I recently bought a z-wave stick and attached it to the Pi, editing the docker-compose.yml to add the device. After docker-compose down and docker-compose up I get the following error no matter what I try:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] udev.sh: executing... 
starting version 3.2.9
[01:48:54] INFO: Update udev information
[cont-init.d] udev.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Error loading shared library libpython3.7m.so.1.0: Exec format error (needed by /usr/local/bin/python3)
Error relocating /usr/local/bin/python3: _Py_UnixMain: symbol not found
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

I removed the z-wave stick, reverted to my old docker-compose.yml file, but am still getting the errors. So far I’ve tried rebooting, apt update, upgrade and dist-upgrade, uninstalling both docker-ce and python3 (and associated packages), then reinstalling (all from apt). I’ve tried specifying a few of the recent but older versions, I’ve tried running without docker-compose, including some of the following commands, after docker system prune -a -f:
docker run --init --name="home-assistant" -e "TZ=America/New_York" -v /home/pi/hass/config:/config --net=host homeassistant/raspberrypi4-homeassistant:stable
and
docker run --init --net=host homeassistant/raspberrypi4-homeassistant:stable
All give the same output above (docker-compose loops that output because it’s set to auto-restart)
I’m at a complete loss of what to do, short of nuking and reinstalling the whole Pi, which I’d rather not given the other things running on it.

Any other suggestions of what I can try?

In which editor did you edit your files? The error says format error. Maybe you edited the file from windows which changed the format of the file?

I used vi to edit the files. However even this command does not work:

docker run --init --net=host homeassistant/raspberrypi4-homeassistant:stable

which should use any of my config files and instead start from scratch.

My guess now is that docker is completely broken on my system and I will have to do a full system wipe and reinstall :frowning: