You have two different things here.
In the first example, you define a private field of a public type. Then you return an instance of this public type using the public method. This works because the type itself is already open.
In the second example, you define a private type, and then return the instance through a public property. The type itself is private and therefore cannot be published publicly.
A more equivalent example for the second case would be the following
public enum MyEnum { Alpha, Beta }
source share