This method works well. Although I don’t think this is a glitch. Rather, I think that is the Princess Heart’s form of a critical hit, which is affected by the Int stat. I noticed at max Int and with wearing artifacts that provide a boost to the Intelligence stat, I’m hitting that OP laser attack around 1 out of 3-4 tries, which is much more frequently than when my intelligence stat was at 1.
If you look at the description for the intelligence stat in the character menu, it says it affects the chances of a critical strike for wildcard weapons, which is the class that Princess Heart is in, so it makes sense. It’s just a very OP critical strike, because it is sustained as long as you hold the button down.