x16xel error code 335 & 340 won’t come any further…

hi, after motor change x16xel for x16xel the motor runs pretty bad, the motor control light goes off briefly at start and then on again. error codes: P0335 wrong speed signal P0340 camshaft sensor signal faulty P0351 EST line ignition coil 1+4 voltage high P0351 EST line ignition coil 1+4 voltage low P0352 EST line ignition coil 2+3 voltage high P0352 EST line ignition coil 2+3 voltage low P0400 linear AGR system P0412 secondary air intake valve voltage hoc h P0412 Secondary air inlet valve Voltage low P1405 Linear AGR position 400 & 1405 should still be from the old motor because I had just cleaned the agr 351 & 352 certainly come from the ignition plug test and pull off cables 412 – the relay I have retrofitted, had to take the other suction bridge (above) so should also not be up to date. stay 340 & 335 I checked the order of the ignition plugs again, camshafts & crankshaft sensor replaced , the cable to the camshaft sensor measured , position of the crankshaft disc , this could already be changed , this could be due to the timing belt voltage ? what can I test?