What's the relationship between corporate profit margins and inflation?
There isn't any strong relationship between corporate profit margins and inflation. There isn't even a priori reason why increase in profit margin should automatically coincide with increase in prices since profit margin does not depend just on prices companies charge, but other factors such as costs. As such it is perfectly possible to observe increasing profit margins and decreasing inflation and vice versa.
Conventional View on Inflation
Inflation is a macroeconomic phenomenon that is not considered to be caused by microeconomic factors such as change in the profit margins (hence the result of the survey of the top Ivy League economists).
Inflation is positive change in the price level. Price level is determined by money market equilibrium. In simple textbook macro models this equilibrium is described as (e.g. see Blanchard et al Macroeconomics an European Perspective pp 105):
$$ M/P = L(Y,i) \tag{1}$$
where $M$ is money stock, $P$ price level, $L$ demand for money that depends positively on real output $Y$ and negatively on interest (price of money)
by solving for $P$, log-linearizing, and taking time derivative of the expression 1 we can arrive at:
$$\frac{\dot{P}}{P} = \frac{\dot{M}}{M} - \frac{\dot{L}}{L} \tag{2}$$
where $\frac{\dot{P}}{P}$ is the inflation rate $\pi$, $\frac{\dot{M}}{M}$ is growth rate of money supply and $\frac{\dot{L}}{L}$ is growth rate of money demand (where $\frac{\dot{L}}{L}= \frac{L_y'}{L}\frac{dy}{dt}+ \frac{L_i'}{L} \frac{di}{dt}$). So inflation is ultimately determined by tug of war between money supply and money demand.
More specifically, you from the signs of derivatives you would expect inflation to increase when money supply grows, or when output or interest rate falls.
Of course, the above is a bit oversimplification, what matters is also people's expectations for example. However, firm profit margins are not major factors. Even if the profit margins would increase because of increase in market power, market power changes gradually would hardly explain large increase in inflation sustained over time.
You Can See It Empirically
You can clearly see empirically that firm profitability is not connected directly to inflation. The data you show for profitability of S&P500 are not available publicly so I will use alternative measure of after tax profit to GDP for US firms. This is in any case much more appropriate measure as it does not focus on few 'lucky' large firms as S&P500. This data is provided by Fred here. I will use inflation for all items in the US again provided by Fred.
As the plot clearly demonstrates the profit share of GDP is completely orthogonal on inflation rate.

On Corporate Greed "Theory"
Second, you mention an explanation for high inflation, something you called 'corporate greed theory'. Even if inflation would be causally connected to profit margins, saying that change in profit margin is caused by corporate greed is absurd prima facie.
Let me explain. I would agree with the statement that in general business people are greedy, I suppose that comes with the territory of being a business person. In economics we commonly assume that businesses want to only maximize profit or that managers want to maximize their own utility. Maximizing profit/utility as sole objective could be interpreted as greediness, even though a scientist should not talk in moral terms.
But thinking that something so rapidly changing as profit margins or inflation can be traced to behavioral traits of adult humans, which can change at best at snails pace, like greed does not make sense prima facie. Business people were most likely equally greedy in 2020 or 2010 than they are today. I personally doubt that Bezos was somehow more charitable in 2010 than today.
To illustrate that linking profit margin to corporate greed is absurd, consider industry level data on profit margins. According to industry level data provided by NYU Stern School of Business
in 2022 the net profit margin for US auto parts seller was 1.34%, but profit margin for auto & truck companies was 3.96%. So does this mean auto & truck companies are somehow more greedy than auto parts sellers? For air transport the profit margin was -7.66%, so people doing air transport are paragons of charitableness? Hotel industry had profit margin of -28.56% so it seems that landlords are very charitable bunch.
Even if we would use the profit margin graph of S&P500 you provided it does not make any sense. Would it make any sense to say that American business was greedy in 1948-50, but then suddenly between 1952-70 US businesses got much less greedy? And this was apparently followed by period of elevated greed during 1972-80? Then suddenly after 1990-2000 which was by the way also era when inequality in US increased dramatically, business were the least greedy they ever were in recorded history? Also what about the dip in S&P500 profit margin in 2008 and 2020? Was that a brief crisis or shortage of corporate greed followed by strong rebound of corporate greed in 2022?
If you just try to formulate the greed “theory” out loud it makes no sense, but as most hoaxes I can understand why that sort of explanation would resonate with laymen because it for sure must hit the right heart string.