The last time I had a P0400 code was when I was stock and legit.
The cause was a failed EGR valve diaphram. I replaced the EGR valve and all was good.
Since you have a new EGR valve I would check the vacuum connections to the valve as well as the other vacuum connections (can't remember them off the top of my head but there are other vacuum lines associated ... along with a solenoid).
It's possible that one of these lines is ruptured or the solenoid is bad.
Testing the lines is easy. Disconnect and put your finger over one end... suck on the other. No jokes, please.
I'm not sure how to test the solenoid.
I bitch about this but .... buy the real shop manuals..
www.helminc.com
They are invaluable.