I believe it's optional.But thought on the A9ii the shutter closed when changing lenses to prevent dust issues.
Closing the shutter will prevent dust from outside reaching the sensor while the lens is removed, but dust can still get into the rear element space of the lens, or the area of the mount in front of the shutter, and when you then attach the lens and the shutter opens, any such dust can get onto the sensor - so it's a partial solution.
The downside is that you risk damaging the shutter via contact when the lens is removed.
Given that shutter failure can totally prevent the camera working, and replacement is very expensive, while dust bunnies are usually only visible at smaller apertures, and can be removed in post and sensor cleaning is cheap, I'm not sure if it's an option I'd use.