The two people had attempted to wade back to shore from a sandbank, the coastguard said.