"Missing package product" error for all local Swift Packages when switching git branches

@NeoNacho The Package resolution log shows no errors. Looks like it only applies to remote swift packages. Here is the export of the log. The error above is specifically for local packages only.
Package Resolution log:

Showing All Messages   
Resolve Package Graph
Activity Log Complete    6/30/20, 11:26 AM    7.5 seconds

Build log:

Showing All Messages

Prepare build
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

Build target <target name> of project <project name> with configuration Debug
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
error: Missing package product '<local package name>' (in target '<target name>' from project '<project name>')
Build failed    6/30/20, 11:19 AM    1.2 seconds