Escaping the treasure room in Fossil Fighters comes down to a bit of clever digging. You need to dig in the space between the two black bones.
That's the reason the game hints at digging "on the side" in pink, it's pointing you toward that gap between the bones. Line up your dig there, and you'll break out of the room and continue on your way.