SObjectPropertyEntryBox not saving selection

Hello there, recently I’ve been learning Slate for the purpose of creating In-Editor Tools with C++ so I can easily integrate them with the rest of my workflow. In one of my Slate Widget, I used SObjectPropertyEntryBox and it has a glaring problem: it doesn’t save selection.

I tried using OnObjectChanged delegate and found that the name of the Texture2D loading and its size are both correct. But when I try to assign the Texture2D to an SImage, the editor just crashes and I couldn’t find out why. I surfed around the internet and found a couple of people having the same issue but they had no answers to their questions. I also tried other things suggested by ChatGPT and Bard, but their solutions failed as well. I tried creating a wrapper for UMG and that too failed. I created a fresh new project and tried everything and that did not work.

The current code I’m using

SNew(SObjectPropertyEntryBox)
	.OnObjectChanged(this, &SWeaponDataWidget::ChangeWeaponIcon)
	.AllowedClass(UTexture2D::StaticClass())
	.DisplayBrowse(true)
	.DisplayThumbnail(true)
	.DisplayUseSelected(true)
	.EnableContentPicker(true)
	.DisplayCompactSize(false)
	.AllowClear(false);

Thanks in advance.