Other plotholes
I'm one of those that are fascinated by the artistry of the movie, but can still see plotholes. I have several that haven't been mentioned yet.
(1) What was the real Madeleine doing while Scottie was trailing the fake one? Wasn't there too much danger of her seeing Judy dressed as her, or Scottie seeing both women and realizing the impersonation scheme?
(2) HOw is Elstir sure that Scotty would take Madeleine to the mission? In the movie, the fake Madeleine describes the place as a dream, and Scotty recognizes the description and decides to take her there. If Scotty hadn't recognized it, the whole scheme would have fallen through.
(3) Was the real Madeleine still alive when Elstir took her up to the belfry? If not, how could he take a body in and up without somebody seeing him and getting suspicious? If she was alive, didn't Elstir have the risk that Madeleine might scream at a time Judy was still with Scotty, again ruining the entire plan?
(4) Even if Elstir wanted to dump Judy in the long run, wouldn't it have made more sense for him to get her out of San Francisco, lest Scottie met her ( as he does)?