What automation mode were you in?
In your automation control window, was "Plug-in" or "Volume" write enabled?
What do you mean by "automating downward expansion"? This is usually set and forgotten about with a plug-in.
And what do you mean "turn it to off"?
If you mean you are setting the controls for the plug-in with the automation off, you MUST copy the automation settings before turning automation back on, because once it's reading automation again it switches back to whatever your track has written to it - i.e. if you don't copy the settings before you enable automation again, all your fiddling and work will be gone once it's snapped back to what was previously there.
Let me know if I understood correctly.