This can help fix it by tracking the json file, unfortunately nightly and doesn't look like it is ready to be stabilized
rust-lang/rust#99515
Scenario:
Dependency program has a new endpoint, update IDL, still no cpi method for it...
The solution right now is cargo clean then cargo build