Ok, I think I got why that has worked. the problem here is that you do not add some PRIMARY to your replica set. you wouldn’t want to do this every time you try to add another machine as primary.
- start your new machine (container) to be part of the replica set
- login to the current replica set.
- add the new member and set its priority higher than others to be elected as primary.
all members can be a primary depending on their priorities (or never if set otherwise) through a voting system amongst the members.
as for downgrading, can you please check this answer about running version 6 on your Pi: How to install mongodb 6.0 on Ubuntu 22.04 - #4 by Yilmaz_Durmaz
PS: as I stated in that other post, I run version 6 on ubuntu-in-a-docker-container, and should in theory run for you too. the responsibility of breaking things is yours.