I believe this issue might be caused by a glitch in Xcode. There is no functional difference between a manually packed XCFramework and one generated by Xcode, yet some manually packed frameworks fail to work as expected.
I encountered the exact same problem while trying to package vendor-provided static libraries into XCFrameworks. Some libraries worked perfectly on the first attempt, while others consistently failed. After some experimentation, I discovered that copying the modulemap from a working XCFramework to the non-working ones resolved the issue. Suddenly, everything started working as intended.
For reference, I’ve shared my working setup for the WechatOpenSDK XCFramework here: WechatOpenSDK. Feel free to check it out if you’re facing similar issues.