> If Netanyahu produces a document from the Israeli Supreme Court allowing his actions, doesn’t that make it impossible to prosecute him?
No, it does not.
> ICC works in conjunction with national courts
Not in the way you are suggesting.
> If a country has a functional, independent judiciary, that judiciary gets the right to address the wrong
No, the ICC will rule a case inadmissible if a state has investigated and/or prosecuted that specific case (not just if it has some general level of legal functionality), unless the ICC also fines that the investigation or prosecution was not genuine (e.g., was pretextual for the purpose of, say, giving the accused an exonerating document to wave around to protect against ICC prosecution.)
See Article 17 of the Rome Statute.