the 4AFE ECU will not run the 5AFE engine because the 5AFE does not have a cam sensor (G1) in the distributor, The 4AFE uses a cam and crank signal to operate - the 5AFE only uses the crank (NE) signal. The 4AFE distibutor will have 2 plugs of 6 and 2 pins while the 5AFE would have 2 plugs of 4 and 2 pins
to check functionality of what you have,
trace the TPS wires back to the ECU and see where they terminate. then check the relevant pinout. Most probably you have an ECU that uses no IDL pin but rather just the angle sweep. (some export models Toyotas have this configuration - Indus Corolla with 4AFE has it - no IDL pin) hence they use a different 3 wire sensor.
Check appropriately and the problem will find a solution eventually.
Do look at your ECU pins that if you have, S1, S2 and SL pins.