I would first check the fuel pressure. The fuel pressure valve is a cheap, easy to swap part. And a wrong fuel pressure can cause this because:
The necessary injection quantity is calculated by the ECM, which depends on the amount of air sucked in, the data from the o2 sensor, the revolution speed of the engine, the throttle position, the engine temperature and so on, and realized by the fact that the injection valves are opened for a certain time.
In order for the injection quantity to be correct, there must be a defined fuel pressure in the injection rail.
This works so that fuel pressure comes from the rear fuel pump, which is applied to the injection rail and is released again in a controlled manner by the fuel pressure valve in order to achieve the necessary pressure.
If this small component is worn out and the correct fuel pressure is no longer present, or the fuel pump no longer delivers the correct amount of fuel, the injection quantity is no longer correct, then nothing is correct...
There is a small valve in front at the fuel rail, where you can measure the fuel pressure with a propriate gauge.
And ask yourself if your car has a fuel filter and when you changed it for maintenance....