IMHO the "request participant added"-notification is dangerous in most of the scenarios, but I get why you would want to have it activated.
I think the problem is that the notification is instantly being queued when an issue is created (see https://confluence.atlassian.com/jirakb/troubleshooting-slow-stuck-notification-issues-in-jira-service-management-server-1041076874.html#Troubleshootingslow/stucknotificationissuesinJira/ServiceManagementServer/DataCenter-TroubleshootingJiraBatchedNotificationmailissues ), so even if you remove the request participant directly after the ticket creation with A4J, the notification is still sitting in the queue waiting to being processed.
A possible workaround might be to delete the corresponding mail from the queue table AO_4E8AE6_NOTIF_BATCH_QUEUE, but that sounds pretty risky and I would not recommend trying that... 
Instead, I would like to add a different approach:
For incoming mails, I tend to use the "Jira E-Mail This Issue"-App for all incoming mail-handling, since you can simply define far better routines / handling / rules there, also including (failed) mail logs and corresponding alarms. (You might have that app installed anyway - or how are you sending attachments to your customers?
) Within JETI, you can define how users are stored within a ticket depending on their user role, so e.g. an Agent can be added as Watcher instead of Request Participant. So every time an Agent is added "as CC" in incoming mails, the Agent will be set as Watcher, thus only receiving the internal notifications.
Edit: Since I could not add a screenshot: here's the link to the JETI documentation, illustrating what I'm talking about: https://docs.meta-inf.hu/email-this-issue/v/email-this-issue-for-jira-server-data-center/documentation/incoming-emails/mail-handlers/next-generation-mail-handlers#nextgenerationmailhandlers-savesendersandrecipientssenderrecipientsaction
Please note that the config in their screenshot is horribly wrong for this case, since they're saving the Agent as Request Participant...! Instead chose "watcher" from the dropdown there...!
This will however not solve the problem when an Agent is added via the customer portal / sharing option...
Another idea would be to deactivate the "request participant added"-builtin notification, and trying to trigger a similar notification with Automation for Jira instead. The trigger could be something like:
- WHEN issue modified
- for field "request participant"
- then check: is the user an AGENT?
- if yes
- then remove the agent, add him/her as watcher
- ELSE
- then send a mail to the added participants "you were added as request participant to the ticket XYZ-123"
The tricky part here might be getting the freshly added user's mail address (=the new request participant) and using only that in the "then"-trigger. I'm not sure if A4J will let you access this specific value, but might be worth trying. Maybe it's possible to access it with a smart value and getting that last or first object of the list...? (e.g. {{issue.Request Participant.last}} or similar might do the trick)
(That being said, the "send mail"-notification will not include your project-defined customer mail template... alternatively you could use a "then: comment"-action here, but that will spam the ticket and send the info about "someone was added to the ticket" to all members of the tickert (Reporter & Request Participants...)
I hope this helps!
I think it's not easy to solve this, but the main problem remains that agents are accidentally dragged into the "role" of a customer. There is a user role concept in JSM, I don't get why this is not being checked upon creating the corresponding (customer/internal) mail notifications. (If user role = agent > send internal notification. else send customer notification... doesn't sound too complex to me, when adding mails to the mail generation queue.)
We have automation set so a customer comment will transition a ticket to 'pending support'. This is a huge issue if a reporter is sharing a ticket with our service desk agents. When they add a response comment to the reporter, JSM views it as a customer comment if that ticket was shared with them. We have automation in place to remove the agent as a participant if it's shared with them after they're already assigned to it, but we can't seem to find a solution if the ticket is shared with one of our service desk agents before it's assigned. We'd really like to see some progress made on this request.