There is a bug https://bugzilla.mozilla.org/show_bug.cgi?id=1860965 closed as "invalid". In fact there is nothing invalid in it. The OP got error because of Thunderbird not processing OAUTH properly, which happened because of the app setting which conflicts with the selected auth method.
This is not an acceptable user experience. For instance, on this my laptop the install was fresh, I never switched the setting, maybe it was an upgrade I dunno - but the bottom line is, that's not my problem why this TB decided to have the setting off, if I never unchecked it. As such it should not be my problem to watch Gmail OAUTH window saying "HTTP 400. Do not retry." without any lead whatsoever.
Feature request: before even attempting OAUTH when adding an account through any method, TB must warn the user that their cookies are disabled. TB may suggest the following options: