"Expand when" configuration honors the state of layout at design time and executes the when rule only during initial load. But once the layout is expanded manually or through a server side when condition, it remains in an expanded state for further AJAX requests. It is designed this way to always honor the user preference ahead of the expand when. There may be use cases where the user expands the layout manually and expects the layout to remain expanded, irrespective of whether the when condition is true / false. Also developers need to keep in mind that this is an expand when condition and not collapse when condition.
Please have a look on the below article for more information :