Ok, this isn’t a captive portal issue.
It sounds like reflashing isn’t fully replacing the existing partitions, so there’s likely some residual data being left on the SD card from the previous image.
The fix depends on which Pi you’re using:
If it’s a Pi 4:
I have a universal image here:
Flashing that should deep-clean the partitions, so no leftovers from the old image remain on the SD card.
If it’s a Pi 5:
I’d suggest first flashing a completely different image, something like RetroPie. That should fully wipe the existing PiFi partitions. Then reflash PiFi afterwards.
The issue seems to be remnants left on the SD card that aren’t being cleared properly. It doesn’t sound like an app cache issue.
I’d recommend fresh threads for this kind of question in case someone else encounters it as not related to captive portal.