Internal global actor on public API not accepted in XCFrameworks

Currently if I try to use following code in FrameworkA for example:

@globalActor
actor MyGlobalActor: GlobalActor {
    static var shared: some Actor = MyGlobalActor()
}

@MyGlobalActor
public func myFunc() {
    
}

from FrameworkB in Xcode framework target or Swift Package target, I am able to call myFunc from FrameworkB by adding async prefix without any issue.

But once I convert FrameworkA into XCFramework and use it in FrameworkB I am met with following error:

no type named MyGlobalActor in module FrameworkA

failed to build module FrameworkA for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug

Making MyGlobalActor public resolves the above issue. Is there any reason this is allowed for source based targets but not XCFramework based targets (this could result in someone shipping XCFramework targets while testing the code in source based targets and unknowingly introducing this issue)? Is this a compiler bug?