I have a beautifully preserved 2009 S40, model 2.4 (140 hp) automatic gear,
but unfortunately the high mileage has taken its toll and the engine requires a complete overroll.
I assume that the transmission (gearbox) is also suffering from material fatigue, although no failure has occurred.

I happened to come across an interesting offer, so I would love to hear and take your advice on the technical aspect:
a S60 that got a total loss following an accident in the rear side, the engine is a 2.4 T5 producing 280 hp with an automatic transmission (B5244T5) that has barely covered 90 thousand km.
The owner is the first person who buy it from the dealership at the time.
And in the context of negotiations with him (the seller), the cost of purchasing a complete vehicle is slightly lower than the cost of the overroll work and stuff by the mechanic.
I'm definitely excited about the idea, but in a practical way I'd love to hear the level of chances of success without surprising adventures.
So I'll ask a little bit questions to understand and have a explain:
Does the central electrical harness (loom) of the engine and transmission connect directly to the harness of the body BCM and the interior of the car?
are the motor and gear mounts locations in the the same plase location in the front compartment?
The fuel pump is submerged in the tank, replacing the entire housing with the current tank is a one-to-one fit?

Besides the radiator, the location of the cooler, the exhaust pipe will require additional modifications besides the entire engine compartment, one after one from the S60 to the S40 engine compartment..
Also, if the swap (and it is likely) was done earlier, I would love to receive links and documentation of they project in order to learn and see (and be impressed) by they work..

Thanks in advance, Aditi

You will be much better off (time wise, cost wise and sanity level)

By buying a complete new car and you’re done

The newer type more modern Volvos are not as mechanic and diy friendly as the older ones are

You forget its a volvo engine! Just replace the transmission fluid regularly, and then when it eventually fails, replace the whole transmission and keep driving it! the engine will go forever aslong as you keep up on oil changes and dont let your cooling system go unmaintained (this is especially important on the p1's, which are prone to cooling system failures). how many k's? i would ask the mechanic why exactly he wants to overhaul the engine, seems suspicious to me.

But yes, i agree with ramrod, if you want a cool spec modern volvo, your best of just buying one that came that way from factory.

It might be relatively easy (like @jaykenneally swapping a V8 into a V70, which was almost completely plug and play). I think you would want to start by looking at what ECU your S40 is running VS the S60, if the ECUs are similar then there's a good chance the wiring will be similar too.