UE 5.0 assign materials over editor utility problem. Changes do not save.

Use transactions: https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Transactions/

Example of use: https://dev.epicgames.com/community/snippets/7be/unreal-engine-editor-utility-assign-materials-to-static-meshes-based-on-index