Could it be that you trying to return UMeshComponent instead of USkeletalMeshComponent without casting it first?