After doing a quick test with a friend, I found out that Magic Room does not prevent Necrozma from undergoing Ultra Burst.
--McFlyMan (talk) 16:17, 5 July 2018 (UTC)