Let's talk code, since what you are saying makes no sense.
Sending a new ticket over the web
The form is submitted to ATS' ticket controller using the save task. This calls \Akeeba\Component\ATS\Site\Controller\TicketController::save().
Since \Akeeba\Component\ATS\Site\Controller\TicketController extends \Akeeba\Component\ATS\Administrator\Controller\TicketController and the Site version of the TicketController does not override the save() method we end up calling \Akeeba\Component\ATS\Administrator\Controller\TicketController::save().
This method calls the \Akeeba\Component\ATS\Administrator\Controller\PostController::post which calls \Akeeba\Component\ATS\Administrator\Controller\PostController::postSaveHook which calls \Akeeba\Component\ATS\Administrator\Mixin\ControllerNewPostTrait::postNotifiable which sends the email by doing
(new EmailSending())->sendPostEmails($post, $ticket, $newPost);
Sending a new ticket over email
Regardless of the method you use to fetch email (CLI, web, Joomla Scheduled Task) you always run \Akeeba\Plugin\ATS\Mailfetch\Fetcher\EmailCheck::checkEmail(). This always calls \Akeeba\Plugin\ATS\Mailfetch\Fetcher\EmailCheck::processEmail().
At the very end of that method we call \Akeeba\Component\ATS\Administrator\Mixin\ControllerNewPostTrait::postNotifiable which sends the email.
What does this mean
As you may have spotted above, regardless of the way the new ticket is created, you always get to run the same piece of code: the \Akeeba\Component\ATS\Administrator\Mixin\ControllerNewPostTrait::postNotifiable() method.
Note: This is not a new thing! This exact code structure was introduced in 5.0.0 back in December 2021. Before that, the respective controller methods were calling a plugin event which was still running the same code whenever you submit a new ticket or reply ever since version 0.0.1 back in 2010. There was never code duplication when sending emails. Using the exact same piece of code, appearing once in the code base, is a fundamental principle of software engineering called DRY (Don't Repeat Yourself), one which I took to heart decades ago. But I digress.
You can read the code for the aforementioned method in administrator/components/com_ats/src/Mixin/ControllerNewPostTrait.php lines 135 to 177. All this method does is basically instantiate the \Akeeba\Component\ATS\Administrator\Model\EmailSending model and call its sendPostEmails() method.
As you can see in administrator/components/com_ats/src/Model/EmailSending.php this code does NOT care where it was called from, i.e. it doesn't care if the ticket is created over the web, from an email, or from custom code running in any way (plugin, module, component, frontend, backend, CLI, API, whatever). It always figures out which email template to use, applies the support staff (manager) user filtering options in the category, and uses Joomla's Mail Templates feature to send the email. Then, it sends the email to the ticket owner when necessary (new ticket, reply from someone other than the ticket owner himself).
Likewise, Joomla does not care how or where from you call its Mail Templates feature. It will try to send the mail using Joomla's configured mailer regardless. The mailer is configured from your Global Configuration which, again, is the same regardless of which Joomla application (frontend, backend, API, CLI) you are using.
As I said, sendPostEmails() first processes manager users, then sends the email to the ticket owner (if it is a new ticket or the post was created by a user other than the ticket owner). This tells me, and should also tell you, that since your ticket owner receives the email both times, this entire email sending code has executed both times, web and email ticket alike. Therefore, the problem does NOT come from our code.
Since your mailfetch runs from the web we can also eliminate any possibility that the problem may stem from differences between web and CLI. For example, if you are trying to send email through a Microsoft 365 account you need a connector plugin as Joomla's default SMTP handler can't operate with Microsoft's XOAUTH2 authentication scheme, and I know that some of these connector plugins are badly written and won't work under CLI. But you have told me this possibility is eliminated.
Moreover, I would like to remind you that I did test new ticket submission over the web and email, and even tested email fetching using different methods (CLI, web, and Joomla Scheduled Task running over the web for good measure). No problems with any of these tests. If you were using Joomla Scheduled Tasks over CLI to fetch the email I could think of a possible issue (the task notification system plugin in Joomla breaks under CLI, causing issues when running scheduled tasks under the CLI until you remove it), however unlikely it is that you are operating under these conditions. But since you told me that the client always receives the email I have to also eliminate this possibilty, as this issue would result in nobody getting an email notification.
Which is to say, what you are telling me here is an impossibility. The only explanation is that your web server or mail server drops emails for reasons unknown, or you are not using the same user and category for your web and email tests (which would bring us back to a possible configuration issue). What I can tell you is that given all the information you have provided, this issue cannot be reproduced and cannot possibly come from our code. Now that I have explained the code flow you're welcome to try debugging it yourself if you'd like. I have already spent more than five hours chasing this particular windmill and I'm unlikely to continue doing so.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!