A warning has been issued after a teenager became trapped in a sand collapse on a Gold Coast beach.