hi guys

i need help with my car issues

i just bought the car a4 b6 2.0 alt engine

the car has parked for a while. doe to engine bearing failure i bought it and the engine on the trunk already dissembled by previous owner

i rebuild the engine

new pistons and piston rings
new crankshaft and new bearings
new oil pump
new balance shafts
new timing belt
but the cylinder head i didn't rebuild it because previous owner told me he already did so i just but back engine in the car one peace plugged all connectors back to all sensors

scanned the ecu before staring the engine cleared all dtc

and than i start the engine ts toke long time till it start the engine runs good no missing idle smooth but the is tiking noise lifters i guess at higher rpm the noise disappear

the problems is if i turned off the engine its takes long to start hard starting sometimes start at first time i crank it i take it for ride and the issues start coming

poor performance if i accelerate hard engine stumbling then stalls when try to start it again wont start keep trying crank crank crank then start i drove back to garage

scanned ecu here trouble codes
P1118 HO2S Heater Control Circuit(Bank 1Sensor2)Open 004 No Signal/Communication
P1292 Map Controlled Engine Cooling Thermostat -F265-Open circuit 004 No Signal/Communication
P1114 Bank 1,sensor 2Internal resistance too large 008 Implausible Signal
P0341 Camshaft Position Sensor CircuitRange/Performance 004 No Signal/Communication
P0102 Mass or Volume Air Flow-G70 Circuit Low Input 002 Lower Limit Exceeded
P0130 O2Sensor Circuit,Bank 1-Sensor1Malfunction 004 No Signal/Communication
P0116 Engine Coolant Temperature Circuit Range/Performance 008 Implausible Signal
P1290 Engine Coolant Temperature(ECT)Sensor(on radiator)-G83-Signal too
large
checked timing ok i replaced the camshaft sensor same code comes back P0341 Camshaft Position Sensor Circuit Range/Performance if i removed the plug frome the sensor i got new dtc p0343 Camshaft Position Sensor high input

and for the Engine Coolant Temperature code its because i removed the thermostat from the housing car runs at low Temperature so ignore it

i am suspecting the cam shaft adjuster

so pleas help me guys i confused here any ideas sorry for long story and my bad English i hope you understand my point