The difference is providing a short succinct message that is either familiar or can be looked up as rg does here, vs vaguely saying invalid name without saying why.
It worsens the UX for no reason.
As a sibling comment said, the program already knows why the name was invalid. It would have cost nothing to surface the reason when reporting the error.
I'm not arguing that I think "Invalid name" is a good message here. I don't think it is. But if you're relying on either familiarity or the ability to look it up, then you're still relying on there being a manual to provide that information in the first place if it is not somehow included in the error message itself. As would be the case here with Bee and rg.
The equivalent of BeeBase’s error in your example would be simply “invalid regex”, which I’d say is still more useful as regex is widely understood and there are many tools that you can give regex to that will tell you what is wrong with it.
No, there's a specificity to "name" and "group" that makes them similar, which is one part of why I settled on this example. The other is that I expected the recipient to have experience with regex and find the example dumb, confirming my position that one can very well demand a basic knowledge of the tool that isn't immediately communicated by it.
Like knowledge of the regex language, or having spent ten minutes skimming through the tutorial part of a PDF manual.
In my experience, how to use a manual is a technique more widely understood than regex. Maybe this impression is wrong, I'd welcome something tangible pointing in another direction if it is.