What seems to be happening here is like an "in-universe" version of a game glitch. The damage done by FRIEND is pulling data from elsewhere in the game's memory - specifically, the table used to determine an item's D$ value. This is obviously programmed intentionally, because this is something Toby has included in the game on purpose, but it's referencing something that tends to happen when something in the game isn't working correctly.
Namely, this is what generally happens during a memory buffer overflow. There's a lot of technical stuff to this, but to make this as simple as possible; most 16-bit games (think SNES era, which matches Deltarunes style) can only "count" to 256. If something exceeds 256, then it either underflows - setting the counter back to 0 and starting again - or the excess 'overflows' into the next available counter. An overflow causes weird things to happen, as the game will sometimes continue to read (or write) code past the point it's supposed to stop doing that. This can have various unintended effects on the game, as the game starts pulling garbage data from other parts of its memory, like the co-ordinates of sprites on the screen... or tables of item data.
So what seems to be happening here is that either the damage number from FRIEND's attack is so astronomically high, or the attack itself is so incompatible with the game's reality, that it blows right past the data used to calculate damage. Instead, it causes the game to glitch, and calculate damage from a completely different section of memory, containing completely different data. Deltarune itself - the game program or app that exists on our console or PC - is working just fine, but whatever the hell is up with FRIEND is causing a memory buffer overflow in the game's reality.
And this is during a Chapter where a certain Yellow Flower starts fucking with fundamental "rules of the game" - like having 99 in all stats. Walking out of bounds. Creating an "infinite money glitch" that really bothers Ralsei for some reason. The same Ralsei who likewise starts breaking the game's fundamental rules - like walking over spikes - and snaps at Flowery later because "do you know what will happen if I don't follow the rules??"
I don't know what FRIEND is - but whatever it is, I don't think it's supposed to be here. I think it's like MISSINGNO from Pokemon Red and Blue; it's garbage data given form, a Thing That Should Not Be, that causes all kinds of abnormal things to happen when it's sought out and interacted with. There are even metatextual parallels with MISSINGNO within Deltarune, because anyone who's played the original Red and Blue knows you have to do a very specific set of actions - you know, like the Weird Route - and then go up and down where the water meets the land in order to encounter it. Like the edge of the lake.
Either way, there's something about FRIEND that fundamentally messes with the reality of a video game world - and for the people who live in it, that could be very, very dangerous.