Sort of sounds like the fuel pump may be faulty. Replacing the filter probably made the fuel delivery job easier, so it didn’t fail as quickly as before. But eventually it gets tired and fails. Yes, it is quite possible for a pump to be able to deliver fuel flow for a while, then quit. Or to deliver enough to run the car at lower rpms, but fail at higher rpms. However, If I had this problem I wouldn’t replace the fuel pump until a fuel pressure test confirmed it was bad. Sometimes you have to run the engine on the road while monitoring the fuel pressure to figure out what’s happening. And good fuel pumps can fail intermittently like that if their power get interrupted for some reason, bad relay, or fried electrical connector. I had that problem years ago on a VW Rabbit, fried electrical connection to the fuel pump.