The other answer, about the wrong path and/or permissions, was for older versions of Thunderbird (versions under 91.x). That type of account was, unfortunately, removed.
With newer versions, one solution is to install dovecot on the machine and then create a Mail Account using $USER@imap.localhost. By default, it will ask you to accept the snake oil certificate that dovecot uses. You could install a valid certificate if you feel like it. For local data, it's certainly not necessary.
In May 2025, I did not have to change anything after installation for dovecot to work in this way. All the defaults were perfect (that being said, it does open port 143 and 993 with IP addresses 0.0.0.0 and :: which means anyone on the Internet can access your installation if you allow connections on those ports; my firewall prevents such so I'm safe).