Hmm, you raised an actually interesting point there, but what do you actually mean by the term legal action? That does matter a lot in this case. And another thing, the creators of those engines aren't forcing you to use their engines. So it won't be possible that you can take an action on them.
The only thing that you are able to do is to report a bug to them, and ask them for a possible solution that you can take in regarding that bug. Given that you mentioned engines like UE4 and Unity, it is really unlikely (I'm not a user of those engines) that you encounter a bug that nobody has spotted before, considered the fact that there are a lot of successful titles that use those engines.
Even if you have spotted such an error or bug, the workflow is that you report the bug to them in their bug trackers. Most successful engines do have a large communities often, so it is guaranteed to be fixed unless the bug you are thinking of is not a bug actually, but is the intended behaviour.
So the conclusion is, it is mostly certain that you are not eligible to take an action on the creators of those engines.