Here is why the core has to be deep inside the tube: the cap has substantial size to ensure that the seal will withstand the harsh environment of Mars, the vacuum of space, reentry in Earth's atmosphere, and landing.
Image from: The Sampling and Caching Subsystem (SCS) for the Scientific Exploration of Jezero Crater by the Mars 2020 Perseverance Rover
https://doi.org/10.1007/s11214-020-00783-7