I checked my 99-02 Forester Manual and it has no info on EGR system. Must have dropped it after 98.
P0400 is EGR system flow malfunction. I could not find a detailed explanation but usually, the engine control system detects inadequate flow by attempting to lean mixture w/ EGR dilution (opening EGR valve). If it can't detect leaning, the EGR flow is inadequate and code is set.
Why lack of flow? It can be blocked EGR valve (carbon deposits), blocked EGR passage, or loss of EGR valve drive (vacuum line leak if valve is vacuum actuated). Vacuum is supplied through an electrical solenoid valve controled by ECM. If vacuum solenoid valve is bad, a different code is usually set for this component.
Check EGR system for integrity; vacuum lines, EGR solenoid valve works, no wiring defects.
Remove EGR valve and inspect valve movement and openings for blockages, damage.
Inspect EGR passages (if accessible for clear flow path). In some vehicles, you can "rod out" the EGR passages, but I don't know about yours.
See you down the ROW!
1999 Subaru Forester