The rear oxygen sensor on your Toyota Camry does not affect engine performance nor gas mileage. It is simply in place to determine the catalytic converter's efficiency. With that said, if it is defective, or throwing a CAT efficiency trouble code because the catalytic converter is defective, your Toyota Camry will fail the smog test; but only if there is a trouble code present.
You've mentioned P0420 exists. If this is the case, you Camry will not pass the smog check. The Check Engine Light being illuminated, or a trouble code stored in the ECU (engine control unit) will automatically cause your vehicle to fail the smog check.