Thunderbird and Gmail with two-factor authentication

Yes, as @mithrial said, take a look at what your settings say under Account Settings > Server Settings > Security Settings. Mine look like this:

Schermafdruk_2021-11-12_15-22-46