Kmail does not access directory with emails in new system

My sistem:
Fedora linux 38
KDE Plasma Version: 5.27.8

I’m using the same Fedora linux 38 and KDE version in a number of different workstations and laptops. At each box, my home directory has the same files and structure.
I’ve been using KMail to handle my emails. In all boxes, the mail files are located at
$HOME/.local/share/local-mail
and, yes, the path is set in the Local Folders configuration of KMail.
Recently, I set up another laptop with a full mirror of my home directory, but the KMail app there is not displaying my emails.
When I look at the Local Folders configuration, the folder that was set for the maildir information is
$HOME/.local/share/akonadi_maildir_resource_0
When I set back to the correct path ($HOME/.local/share/local-mail), the system created a new folder:
$HOME/.local/share/.local-mail.directory

So, what is going on here? I guess this is an akonadi issue, but I don’t know where to look.

I have Debian 12 system and will just confirm what you said.

On a new system KMail’s local mail were originally stored to directory
.local/share/akonadi_maildir_resource_0
Then I used KMail’s settings and configured local mail to directory
.local/share/local-mail
In KMail I copied one single mail to a local folder and checked where the file is actually stored. I noticed that the copied mail file is stored in directory:
.local/share/.local-mail.directory

So KMail (Akonadi or whatever) is not using the directory I had set in KMail’s configuration.

Indeed. And it’s a shame that no one from the KMail or Akonadi developer team replied so far.
I like using KDE very much. I’ve been using it for decades, but certain aspects such as these are a test on our patience.
Why is it so hard to make the app work as it was supposed to?
Why is the configuration of Kontact so opaque and difficult to synchronize with another box? Is the problem with Kontact or Akonadi or whatever?
Why does this kind of bug occur? Is it because the different teams don’t have a common standard of configuration procedures?
It seems that the only way to solve these kinds of problems is by spending a lot of time delving into the intricacies of the configuration procedures of each app, but I simply don’t have time for that…
Sorry for the rant.