Thanks @DTS Engineer for the response. My confusion was that if I use dependency manager like CocoaPods it does the embedding at the top level and adds the rpath search path. My understanding with SPM + XCode was that it will behave in the similar manner.
Current docs mention adding package to app target. So you can understand developers will run into this error by following the same steps for extensions.