Could be a blocked or disconnected line or the system not venting or purging properly. The malfunction criteria for DTC P0440 setting is tank vacuum <7.9" of H20. I think the sensor you are referring to is the tank pressure sensor which must function properly for the test to come out good. The one at the engine is the purge solenoid/valve.
Here's some info on odb-ii DTC error code P0440, EVAP Emission Control System Malfunction which may be helpful to you:
The evaporative leak detection diagnostic strategy is based on applying vacuum to the EVAP system and monitoring vacuum decay. The PCM monitors vacuum level via the Fuel Tank Pressure sensor input. At an appropriate time, the EVAP purge valve and the EVAP canister vent valve are turned ON, allowing engine vacuum to draw a small vacuum on the entire evaporative emission system. If a sufficient vacuum level cannot be achieved, a large leak or a malfunctioning EVAP purge valve is indicated. This can be caused by the following conditions:
Disconnected or malfunctioning fuel tank pressure sensor.
Missing or malfunctioning fuel cap.
Disconnected, damaged, pinched, or blocked EVAP purge line.
Disconnected or damaged EVAP canister vent hose.
Disconnected, damaged, pinched, or blocked fuel tank vapor line.
Disconnected or malfunctioning EVAP purge valve.
Disconnected or malfunctioning EVAP canister vent valve.
Open ignition feed circuit to the EVAP canister vent or purge valve.
Damaged evaporative emissions canister.
Leaking fuel sender assembly O-ring.
Leaking fuel tank or fuel tiller neck Any of the above conditions can set DTC P0440.
CONDITIONS FOR RUNNING THE DTC
No VSS, TP sensor, HO2S, Misfire, IAT sensor, MAP sensor, Fuel Trim, Fuel Injector(s), EGR Pintle Position, ECT, or MAF sensor DTC(s) set.
Start up engine coolant temperature is between 4°C and 30°C (40°F and 86°F).
Start up intake air temperature is between 4°C and 30°C (40°F and 86°F).
Fuel tank fuel level is between 15% and 85%.
BARO is greater than 75 kPa.
System voltage is between 8 and 16 volts.