If you are getting the following error in a drupal 9+ website
[error] (Currently using Missing or invalid module The following module is marked as installed in the core.extension
configuration, but it is missing:
* some_module
Here is how you can fix it with drush:
drush cdel core.extension module.SOME_MODULE
where SOME_MODULE is the machine name of the module.