I don’t think the Death Star II had a planetary atmosphere that lightning could be redirected from the way Yoda’s spirit did in TLJ.
Which is to say, I don’t think he created it out of thin air, I think he pulled existing lightning down out of the clouds above or something similar. Which isn’t exactly possible in a hermetically sealed environment like a space station.