As far as I can tell, it's a combination of using Managed Identity with the built-in Logic App Actions for performing operations on Storage Tables, at least in its current state. If you use the "non built-in" actions you won't see this issue.
I saw the same issue the last few days, and in my case my logic apps were merely getting entities rather than inserting. The error in question showed up completely non deterministically, sometimes a payload worked, sometimes the same payload got this error. The only deterministic factor was that the same batches of payloads started out working or mostly working, but the more I ran them, the more of this error I got.
As per your own reply, I tried to temporarily change to a connection string instead of a Managed Identity, and indeed it worked much better, but after changing to the "non built-in" V1 actions (i.e. not V2 which is in preview), it worked fine.
In my case, it seems there's some heavier loads where the built-in Actions with Managed Identity simply doesn't cut it. It's weird that we get a 502 rather than e.g. 429 which we could act upon properly, but it is what it is.
The Logic Apps Designer is unfortunately not very obvious in terms of what type of Action you're using. You switch between the two types when creating an Action in the Logic Apps Designer by clicking either on the tab "Built-in" or the tab "Azure", and to find the non-built in Storage Tables operations you have to specifically write "azure storage tables" in the search box. Leave out one of those words and you won't find it.
