Docker up -d gives "Top-level object must be a mapping" for all files tried, even canned examples

You menitoned the docker compose plugin, but it is still worth checking if you are also using the right command. docker compose and not docker-compose as @bluepuma77 pointed out, however, I don’t think that kind of yaml issue would happen compose files as compose’s top-level object was always required to be a mapping.

Removing compose is easy, as it is just a binary without data and you can could uninstall Docker by removing the package and the data dir and the $HOME/.docker folder but Docker itself has nothing to do with the compose yaml syntax so I doubt that would help.

You could try this compose file:

services:
  web:
    image: nginx

with this command:

docker compose up -d

You could try checking the line endings in your file:

file compose.yml

It should return something like this:

compose.yml: ASCII text

and not this:

compose.yml: ASCII text, with CRLF, LF line terminators

If you get the first one, please show the compose version

docker compose version

The following could reveal some issues as well:

docker info
docker version

Review the output before sharing and remove confidential data if any appears (public IP for example)

snap list docker

When you share the outputs, always format your posts according to the following guide: How to format your forum posts

The docker info command by the way shows where your compose plugin is and you can remove it