SSAO breaks SRP lens flare, does anyone know why?

Whenever I turn space screen ambient occlusion on for unity 2021 urp the flare shows through the walls, how do I fix this? Thanks in advance and have a good one.

I found out that its because the depth texture breaks but how do I fix that?