Creating Asset with Editor Utility

I know this was a couple years ago, but has the pipeline changed? Because I can’t figure this out why I can’t create a data asset using this method. The cast here always fails.