Sorry if this has already been addressed, but I coudn't find the topic anywere.
It looks like if you use the function mean and set the trim argument to a value greater than 0 inside summarise, the output is the same as with the regular arithmetic mean.
If I take the mpg column from the mtcars data.frame and compute the two means separately I obtain this
mean(mtcars$mpg)
[1] 20.09062
mean(mtcars$mpg, trim = 0.3)
[1] 19.17857
Whereas if I do it with summarise it gives this result
The issue with your dplyr code is very simple. mpg in mean(mpg, trim = 0.3) refers to the mpg you created in mpg = mean(mpg). This is why you get the same result. You just need to change the name of your first result: