Xcode Project with Framework - Library not loaded - mapping process and mapped file have different Team IDs

I am starting a new Xcode Project for macOS app. During the initial development I found that some part of the app should be shared between different targets like macOS App, Quick Look etc. The goal was to user Framework. By selecting Project in Project navigator and using the plus icon, I have created a new Framework target and called it Shared.

Next, in my App Project I have added it into the project and checked if it is correctly linked. The framework was Embedded and Signed. Both targets have the same Signing & Capabilities settings.

After I move a code into Shared framework it was time for first run. Unfortunately, the app is crashing instantly, and I am getting the error:

dyld[65044]: Library not loaded: @rpath/Shared.framework/Versions/A/Shared
Referenced from: 
<2B03FB61-86B3-31E5-A2A4-F18F43AEC875> /Users/{User}/Library/Developer/Xcode/DerivedData/AppName-fjfbylcqrxaiobgohprplbaohgbw/Build/Products/Debug/AppName e.app/Contents/MacOS/AppName

Reason: tried: 
'/Users/{User}/Library/Developer/Xcode/DerivedData/AppName-fjfbylcqrxaiobgohprplbaohgbw/Build/Products/Debug/Shared.framework/Versions/A/Shared' 
(code signature in <DD201FE7-57E2-33B1-AD7C-E61BA1345673> '/Users/{User}/Library/Developer/Xcode/DerivedData/AppName-fjfbylcqrxaiobgohprplbaohgbw/Build/Products/Debug/Shared.framework/Versions/A/Shared' 

not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), 

'/Users/{User}/Library/Developer/Xcode/DerivedData/AppName-fjfbylcqrxaiobgohprplbaohgbw/Build/Products/Debug/AppName.app/Contents/Frameworks/Shared.framework/Versions/A/Shared' 

(code signature in <DD201FE7-57E2-33B1-AD7C-E61BA1345673> '/Users/{User}/Library/Developer/Xcode/DerivedData/AppName-fjfbylcqrxaiobgohprplbaohgbw/Build/Products/Debug/AppName.app/Contents/Frameworks/Shared.framework/Versions/A/Shared' 

not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), 

'/Users/{User}/Library/Developer/Xcode/DerivedData/AppName-fjfbylcqrxaiobgohprplbaohgbw/Build/Products/Debug/AppName.app/Contents/Frameworks/Shared.framework/Versions/A/Shared' 

(code signature in <DD201FE7-57E2-33B1-AD7C-E61BA1345673> 

'/Users/{User}/Library/Developer/Xcode/DerivedData/AppName-fjfbylcqrxaiobgohprplbaohgbw/Build/Products/Debug/AppName.app/Contents/Frameworks/Shared.framework/Versions/A/Shared' 

not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs)

The Team ID is set properly in Build Settings for both targets. The Bundle Identifier is different and the rest of the settings seems to be correct. I tried changing and juggling the settings related to signing the framework, but it didn't help.

I am totally lost without any other idea to fix it... I will be glad for some help.