The fact that it cranks and stops kind of leaves out a security issue. If it's an I-Key car then it shouldn't crank at all with a security problem, if it's a hard key then it should crank normally but not start (the ECM kills spark). In either case you should get a solid red security light if that's the issue. You actually may have created a security problem by swapping ECM's. The swapped one won't recognize the key at all, and on some models that makes the original ECM refuse the key once it's reinstalled.
That all said, your first step should be to make sure you have voltage and ground at the OBD port (DLC). Pins 16~4 and 16~5 should light a test lamp at all times or fuse #19 is probably blown. Pins 8~4 and 8~5 should light a test lamp with key on or fuse #12 is probably blown. You can find the wiring diagram for the DLC here on page GI-61:
https://www.nicoclub.com/service-manual ... 8%2Fgi.pdf
If that all checks out, measure the voltages at pins 6 and 14 with the key on. I didn't look up which one is CANH and which is CANL, but one (CANH) should read slightly above 2.5V and the other (CANL) should read slightly below 2.5V. If you read anything else then it's likely some device is crashing the CANbus. The transmission controllers (TCM's) on R51's are notorious for killing the whole bus when they fail, so you might try unplugging the transmission umbilical and see if the scanner connects all of a sudden. If so, the TCM is crapped.