Steps to Reproduce
Declare an actor class in C++.
Add a component property:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
UMeshComponent* Mesh;
In the constructor, initialize it as follows:
Mesh = CreateDefaultSubobject<UMeshComponent, UStaticMeshComponent>(“Mesh”);
Note that although we create a UStaticMeshComponent, the property type and return type are UMeshComponent
Launch the editor and create a derived blueprint class
Select the Mesh component and attempt to change the component class via the dropdown. Note that only subclasses of UStaticMeshComponent specifically can be selected, not siblings of it under UMeshComponent (such as UGeometryCollectionComponent)