Answer edited because I originally misread the question.
So you want to negotiate USB-PD voltage to suit the current pulled by your load (for example, a 12V pump). You also need 5V for your MCU, even if the USB-PD voltage is 5V. It runs from a powerbank, so current draw should be low.
The schematic in the question has constantly-on a LM393 (0.8-1mA supply current) and LM4040 (<100µA) so we should try to use less current than this. I'm ignoring the up to 60mA drawn by the voltage divider resistors because these could easily be changed.
If your only load on 5V is the Attiny and a few low current sensors, then a simple way would be to use a LDO with low idle current and a PMOS pass transistor.
When input voltage is higher than 5V it will regulate it down to 5V, and when input voltage is 5V the LDO will operate in dropout with the internal PMOS fully turned on. In this case dropout depends on the RdsON of the internal PMOS and output current.
As an example let's look at AP7375 LDO: it has an idle current of 2µA which means having it on continuously isn't a problem. Datasheet says:
VDROP = 35mV@IOUT = 10mA (Typ.)
VDROP = 350mV@ IOUT = 100mA (Typ.)
So with your Attiny using 10mA, the dropout would be tiny and it would get almost 5V. Besides, Attiny works fine down to 1.8V, it will run fine on 4.965V too.
It's important to use a PMOS LDO and not a PNP, as the latter will draw current to saturate the pass transistor when operating at low input voltage.
If you have other loads on 5V that use more current, then it would be more efficient to use a switching regulator.
LDO advantages: simplicity, cost, no switching noise, low idle current
Switcher advantages: much higher efficiency at high current
For a few mA current, from a big powerbank, a switcher isn't really needed. For a few tens to hundreds of mA, then definitely yes.
In this case you need a buck chip that can operate at 98-100% duty cycle, so when the input is 5V, it will output 4.9-something volts, and when output is higher it will regulate. Here are two examples: AP63205 TPS54202.