Well, now it gets difficult, and it's unlikely we'll discover the solution in this thread except by lucky guesswork. Otherwise, you're likely going to need to take apart the build process step by step.
When you try to build your app, what device are you building it for? What device did you build your framework for? Note that the device is chosen from the right half of the scheme popup menu that we mentioned before.
My guess is that you built the framework for an actual iOS device (either a plugged-in piece of hardware, or the generic device), but you're currently building your app for the simulator — or vice versa. That would explain why building app A triggers an attempt to re-build framework B, although B already exists. For some reason, building B for the simulator fails. (An iOS device build uses the iOS platform. A simulator build uses the macOS platform, because the simulated app is actually running under macOS.)
One possible reason for that is that you've built library C for an iOS device, and configured B to always use that library, even when B is being re-built for a simulator. The link would fail (library C would contain ARM machine code, B would need Intel machine code), no module would be built for B, and building app A would also fail.
You could test this particular theory by building app A for whatever device worked for building framework explicitly.
It's also possible that this particular settings mismatch is not the cause, but something roughly similar, that also causes B to use the wrong settings. It may be that when adding library C to the target for B, or adding framework B to the target for A, you haven't set the file reference to "relative to build products". Using an absolute or project-relative reference might well cause either build to fail.
Or maybe … maybe … maybe … . There are a lot of possibilities.
Probably your next step is to start examining the build transcript (Report navigator) in detail. There may be more comprehensive error messages in the transcript than is reported as the final build status.