I encountered this in an Angular 12 and Ionic 6 project:
ionic modal main.js:1 ERROR Error: Uncaught (in promise): overlay does not exist
Apparently I dismissed a modal for the second time. So beware of this.
Make sure you did not wrongly import the PopoverController instead of ModalController.
Do not dismiss modal before it was created.