Engine won't rev over 4k

Hey all
First what happened i was driving to a friends house when pulling away for a set off lights my crank pulley came off the 4 bolts holding in to the crank timing gear 2 of which where missing and 2 of the heads had sheared off the main crank bolt was still in place and then engine died (it’s the vvt so it lost the crank signal) . So after a different pulley off my spare engine the wont rev over 3.5k I had the idea that maybe on it’s way off it bang into the crank sensor so i changed that as well i dont noticed any play or damage to the woodruff key or crank noise
It now revs well to 4k now but bounces between 3.75 and 4 and pops and bangs out the exhaust
Now its a vvt swap mk1 running a me221 ecu for a the mk1 so I’m hopping it’s something in the wiring

I cant remember if the revved over 4k before as it’s not been mapped yet and trying to stay out of boost due to not having the car running long enough to get mapped

My question is this how would i go about diagnosing the problem I’ve been read horror story’s on line about crank wobble which with the bolts missing/damage bolts would make sense
ps
Sorry if the spelling or grammar is off working the grave yard shift