That's the thing: by the time the entity leaves, the camera has zoomed so close to our main hero and main villain that their hands and the weaponry they hold can no longer be seen. When we last glimpse a Klingon holding a sword, at the start of the zoom-in, the entity is still there.I've watched the episode about 15 times in just the last 30 days, and don't remember the swords turning back into phasers.
But if they wanted to establish that it was just an illusion, they probably would have inserted a shot of the swords turning back into phasers as the entity weakened, like the way the Salt Vampire reverted to its natural form when it died, or the way "The Cage" revealed Vina's true appearance or had the Talosian's "ape-monster" illusion dissolve back into the Keeper's actual appearance. Ditto for the tiny wriggling aliens in "Catspaw" after the spell was broken . . .
They are ways to make it clear that something is "just an illusion."