The Power of Z!
Even if their attacks weren't doing any damage to Necrozma, they still could have served as somewhat of a distraction, since it would have to deal with them as well as with Lunala and Solgaleo. All of the Ultra Guardians' Pokémon (and Ride Pokémon) have long-range attacks, so they didn't have to get too close to Necrozma to attack.My guess is they couldn't use their Z-Moves so soon after using them last episode, especially with Z-Moves being powered down. And none of the attacks were doing anything, Necrozma was even shrugging off attacks from Lunala and Solgaleo, it was only Solgaleo's Sunsteel Strike that even seemed to do anything and it only broke Necrozma's bond with Lunala, Necrozma was still fine afterwards. Kiawe also pointed out that Prismatic Laser was too dangerous for them and they had to pull back.