Looks like the ski is in limp home mode to me. MAINT flashing on screen and limiting RPM to 5000. Could be a faulty sensor, (there are many on the di) Bad voltage rectifier etc. Prob best to send it to a shop that has a BUDS diagnostics to find out what exactly is putting the ski into limp home mode.
Are you getting beeps with the flashing red light? If so, and you have access to a manual, there is a page in there with beep codes. Different beeps at different time intervals can narrow the problem down to a few items. You really need a manual if you own a di. They are complicated and finicky. I am always working on mine and I would be stumped without my manual.
Just a thought, check all the wiring looms to make sure everything has been connected back to the engine correctly after the engine install. Rave solenoid, Mag cover connections, Air injectors, fuel injectors. etc..... Check every plug.
Could be as simple as a plug hasn't been connected up.
My xpdi has only gone into limp home mode once. Turned out to be the voltage regulator which is a common thing to break on the di's as well as the overpriced fuel pump module. Good luck!!