An Edinburgh man who was the subject of a public police missing person appeal last week, was due to appear in court after he was caught in an undercover police sting.