I was having a Doubles Ubers battle in which my opponent's Primal-Kyogre used Dive and naturally went underwater. On the turn it was set to return to the surface and deal damage, I switched in Primal-Groudon whose Desolate Land resulted in the move failing. The problem arose immediately after Kyogre's attack failed. My Magearna used Dazzling Gleam (a 100% accuracy move) and the Kyogre avoided it. The item on my Magerna is Wiki Berry and the Kyogre had to be holding Blue Orb to be Primal, and there were no accuracy drops or evasion boosts. I've looked into both Dive and Desolate Land and can't seem to find a logical explanation. I've linked the replay below, so hopefully someone can explain this to me, or patch it if it is indeed a bug.
https://replay.pokemonshowdown.com/gen7doublesubers-734320513 (the Dive part starts on Turn 6 and ends on Turn 7)
https://replay.pokemonshowdown.com/gen7doublesubers-734320513 (the Dive part starts on Turn 6 and ends on Turn 7)