Depends on the extent of the scope, per CPT, "For examination of the esophagus from the cricopharyngeus muscle (upper esophageal sphincter) to and including the gastroesophageal junction, including examination of the proximal region of the stomach via retroflexion when performed, see [esophagoscopy codes]."
If the provider planned to do a full EGD, entered and examined the stomach, and attempted to pass the pylorus but was unable to, use modifier 53.
If the provider did not plan to examine the duodenum, but entered and examined the entire stomach, use EGD code with modifier 52.
If the provider was unable to examine beyond the stomach proximal to the GEJ, use an esophagoscopy code.