I have been working on a battery back up for my raspberry. The idea is classic: connect power bank to wall outlet and raspberry to power bank output. It works well with only battery power. But when the power bank is plugged to the wall at the same time it's supplying to raspberry, I get the "low power" lightning bolt signal on the right upper side of the screen, and even worse, if I unplug the power bank from the wall, my raspberry simply shuts down.... Any ideas on how to prevent this? I would like it work as a UPS where in case of a blackout, the power bank prevents the raspberry from shutting down.
Firstly, do you know the voltages being output by the UPS at the moments you described (only wall, only battery, wall and battery)? It may be that your UPS is not supplying the correct voltage the Pi needs, around 5V.
It could also be a power level problem, where your batteries are not "beefy" enough to supply the Pi by themselves. Remember the Pi need at least 500mA (https://electronics.stackexchange.com/questions/386361/how-to-estimate-usbs-power-consumption).
It would be interesting if you posted schematics and the UPS model name for us to help you.
The lightning bolt at the top right is (for me) a mistery, once had a cheap USB cable offering the Pi 4 around 4,91V and the lightning on; changed the cable (for a Baseus one, found on Aliexpress) solved the problem.
It sounds like your power bank is not able to supply enough power to your Raspberry Pi while it is simultaneously charging. This is a common issue with many power banks, as they may not be designed to supply enough current to charge and power a device at the same time. I think a good solution it to use the DFRobot UPS HAT with a compatible battery. There are many more UPS HATs available which you can consider too.