How can I recreate this distortion effect from Midsommar?
Without having seen the movie, it may be difficult to get it down exactly, but here is what I came up with. 


Duplicate your layer twice, so that you have three copies.
On the top layer mask out the person. 





Set the mask feather to around 30px. 
Copy and paste the mask to the other two layers. 
On the middle layer, set the mask feather to 60 and the mask expansion to 60. (can be adjusted to suit).
On the bottom layer, set the mask to subtract mode and add a 'Turbulent Displace' effect to the layer. 
Adjust the size to suit (I chose 30) and you can keyframe the 'Amount' to have it animate on or off. I also added the expression 'time * 500' to the 'Evolution' property to add some movement. 


Here is what mine ended up looking like: 



Hope this is close to what you're after.