Welcome to the forum
In Rangers there was only one version of the 3.0l Vulcan engine, in 1999 Flex fuel model just had larger injectors
So you can't put in the wrong 3.0l engine and it also wouldn't bolt up to transmission
VIN U and V are the same 3.0l engine
But a used engine is a roll of the dice at the best of times
EGR system can cause engine not to run well
The EGR sensor code (P1405) means the DPFE sensor's 2 hoses are not both connected to the EGR tube that runs from exhaust manifold to the EGR Valve, check that both hoses are hooked up
P1408 is because of P1405
DPFE sensor looks like this:
https://bob-ayers.smugmug.com/photos/124318525_acJom-L.jpg
Not vacuum hose connections, both run to the EGR tube/pipe
That tube looks like this:
https://i.ebayimg.com/images/g/z5UAAOSwexddOiAV/s-l1600.jpg
Has 2 ports for hoses, one larger that the other, DPFE also has 2 hose ports one larger than the other, so that matters
P1260 Theft Detected – Engine Disabled
No start at all with this one
So engine shouldn't run at all
This will go away on its own if engine actually runs
The 3.0l Vulcan engine was used in Rangers from 1991 thru 2008, all years are interchangeable and have a unique bell housing pattern so can't be swapped around with other Ford 3.0ls without transmission swap
1998-2003 Ranger 3.0ls were available as Flex Fuel, had a Fuel type sensor, larger injectors and computer software for the larger injectors 1998-2000, in 2001-2003 Flex fuel, the computer was the same as gas-only because Ford change to a standard size injector and dropped the fuel sensor
So I don't think you have the wrong engine, possibly some of the vacuum lines were not hooked up or wiring
Very common to mis-wire coil pack on these
1 2 3
5 6 4
the 564 often gets mis-wired