Unreal (5.4.3) hangs when undoing (ctrl+z)

I recently started learning unreal and any time I undo something the game lags briefly. It depends on what I am undoing. If I undo a landscape sculpt it lags for about 2 seconds. If it something smaller like a prop it lags for about 0.5 seconds. It only happens when undoing things. Adding in props or sculpting the landscape is buttery smooth so I am not sure what is wrong.

Specs:
CPU - Ryzen 9 7940HS
RAM - 16GB ← Maybe it’s this?
GPU - Nvidia 4070 8GB ← Latest drivers

I tried a bunch of different things like lowering the graphics, antialiasing, turning off lumen, and turned of most of the scene editor auto update features. Nothing helped. Any suggestions?

If nothing else works I think I just might downgrade my unreal engine version and try that. Any Unreal 5 version that are fairly stable/any to avoid?