upgrading – Upgrade rector and Drupal check fail with “ambiguous class” errors on unrelated modules

I am running Drupal Core 8.9.11. I have custom module I need to upgrade to run under Drupal 9. Installed Upgrade rector. When I run it on my code it fails, returning errors on unrelated
modules:

Rector v0.7.29
Config file: ../../../../../../tmp/upgrade_rector/upgrade_rector.yml

In RobotLoader.php line 186:

Ambiguous class MYPDF resolution; defined in /var/www/html/websites/drupal8
/master/modules/printable/vendor/tecnickcom/tcpdf/examples/example_003.php
and in /var/www/html/websites/drupal8/master/modules/printable/vendor/tecni
ckcom/tcpdf/examples/example_011.php.

BTW, the above module isn’t even installed in my Drupal project.

So, I deleted the “printables” module directory, ran upgrade rector again,
then got this:

Rector v0.7.29
Config file: ../../../../../../tmp/upgrade_rector/upgrade_rector.yml

In RobotLoader.php line 186:

Ambiguous class DrupalswiftmailerFormMessagesForm resolution; defined in
/var/www/html/websites/drupal8/master/modules/swiftmailer/src/Form/Message
sForm.php and in /var/www/html/websites/drupal8/master/modules/contrib/swif
tmailer/src/Form/MessagesForm.php.

Note that I get the exact same errors when running Drupal Check from command line.

.. Steps to reproduce

Go to Upgrade Rector page: /admin/reports/upgrade-rector

Select my custom module as project. Click on Run Rector. I get “Fail while
processing my module” with above errors.

How do I get upgrade rector to run on just the one module in question and not
unrelated modules?