St.Expander resets session state of dataframe when closing and reopening

Not exactly, I solved the issue but very round about following this: