When I put a molecule on the optimized surface in CASTEP, there will be some atoms in the crystal disappear. Could you
please tell me how to solve this problem? Thank you.
please tell me how to solve this problem? Thank you.

As Reset View on the 3D Viewer toolbar should show this.
If that is not teh case please post the following XSD files: