I am reading between the lines and in danger of being told 'I knew that’; I'll go through the steps I would take.
Firstly TM will only restore data not the operating system.
On Big Sur set up I’d save the current data. This might be done using for example Carbon Copy Cloner to clone the Big Sur onto to an external hard drive or failing that copy and paste as much stuff e.g. user home folder(s) etc. etc etc onto an external hard drive. The more the better because everything on that drive is about to be lost.
I would then boot up Big Sur mac from an external bootable drive. Once done, then I’d erase the Big Sur drive. (that’s why it is vital to take a copy of everything).
I would then reinstall Mojave onto that clean drive. You need to use the latest Mojave installer or have access to all the subsequent updates.
Having now got Mojave installed, I’d plug in that June TimeMachine and run migration assist to copy everything back (including software).
Having done that I’d then go to the Big Sur backup and copy and paste the data that was created between June and now.
So
Copy Big Sur data;
Erase the Big Sur hard drive;
Install Mojave
Run migration assist;
Copy data from Big Sur backup
Just remember backup your existing Big Sur hard drive before you do anything else.