ongoing rear brake issue, hard to press brake lever then normal then hard…

This has been extremely puzzling.

It started when i was riding, the rear brakes locked all the sudden, couldnt press the left brake lever at all. so i unscrewed the banjo bolt quickly just to let enough pressure out and it was operable again.

i bled the brakes later. while riding all day, the brake lever would be hard then soft normal, then hard, then normal. brakes are almost locked when the lever is hard but can still spin.

First i bought a new master cylinder. still same symptoms, all day it would get hard then soft..
I have now replaced both rear calipers , bled the lines. the lever is still hard sometimes and normal sometimes. Even when just parked. i would sometimes press the lever and its normal, then sometimes its hard nearly locked.

what the hell? replace the rubber hoses?