A slow query on MS-SQL-Server 2019 cannot be optimized
After carefully reviewing your fourth question on the same topic, I'm afraid my diagnosis is exactly the same I provided in your first question. Let's look at your first query here.

You can see it executes in 29 seconds. But let's look at compile time (In SSMS: F4 to enable properties and click on the SELECT node):

The number above is in miliseconds. Converting to minutes it's 77. Adding both times together you get  close to observed 78 minutes runtime.
Let's look at the second, &quot;good&quot; query:

6 minutes compilation time.
Now you might ask yourself is this a lot? The answer is yes in both cases. I would consider compilation time in SECONDS slow. Your cases are patological.
I cannot answer what causes it. I will only give some ideas you could try. First a question: is the problem affecting other queries in your system? If yes then maybe something on the instance is wrongly configured. Do you have any funny trace flags enabled?
Your issue actually existed in original database. It must have been carried over. Like schema. Script out all the tables from the query and everything related to it. Is there anything funny? 100 statistics on one table? 100 indexes? hypotethical indexes?
Try cutting up the query. Remove one join or predicate at the time. You will get garbage results, but at some point the reduced query should start compiling in normal times. That will give you a clue what could be causing it.
That's all I got. Good luck.