We first note that it suffices to prove that the sequences are exact on the graded pieces of \(P_{\bullet }\) : the statement about mixed Hodge structures follows immediately from the fact that the mixed Hodge structures on the graded pieces are induced from the standard ones on cohomology [1]}, combined with the well-known fact that the localization sequences are exact sequences of mixed Hodge structures.
To prove exactness on graded pieces of \(P_{\bullet }\)  for the first sequence, we begin by noting that \({\mathfrak {p}}{}\mathcal {H}^l(R\pi _*\underline{\mathbb {Q}}_Y)\)  is a perverse sheaf on \(B\) . Thus, as \(B\)  is projective and \(C\)  is a general linear section, by [2]} we have a natural localization exact sequence
\(0 \longrightarrow {\mathfrak {p}}{}\mathcal {H}^l(R\pi _*\underline{\mathbb {Q}}_Y) \longrightarrow Rj_*j^*{\mathfrak {p}}{}\mathcal {H}^l(R\pi _*\underline{\mathbb {Q}}_Y) \longrightarrow Ri_!i^!{\mathfrak {p}}{}\mathcal {H}^l(R\pi _*\underline{\mathbb {Q}}_Y)[1] \longrightarrow 0,\) 
where \(i\colon C \hookrightarrow B\)  (resp. \(j\colon B- C \hookrightarrow B\) ) is the natural open (resp. closed) embedding.
The functors \(j^*\) , \(Rj_*\) , \(Ri_!\) , \(i^!\)  satisfy the following exactness properties with respect to the middle perversity \(t\) -structure:

\(j^* = j^!\)  is \(t\) -exact as \(j\)  is an open immersion;

as \(j\)  is an affine embedding, \(Rj_*\)  is \(t\) -exact [3]};

\(Ri_! = Ri_*\)  is \(t\) -exact as \(i\)  is a closed immersion;

\(i^![1]=i^*[-1]\)  is \(t\) -exact as \(i\)  is a normally nonsingular inclusion of complex varieties of complex codimension 1 [3]}.

In particular, these functors commute with the perverse cohomology functor, so we have an exact sequence
\(0 \longrightarrow {\mathfrak {p}}{}\mathcal {H}^l(R\pi _*\underline{\mathbb {Q}}_Y) \longrightarrow Rj_*{\mathfrak {p}}{}\mathcal {H}^l(j^*R\pi _*\underline{\mathbb {Q}}_Y) \longrightarrow Ri_!{\mathfrak {p}}{}\mathcal {H}^l(i^!R\pi _*\underline{\mathbb {Q}}_Y[1]) \longrightarrow 0.\) 
By a simple base-change argument, using the properties of the four functors listed above, we may rewrite this sequence as
\(0 \longrightarrow {\mathfrak {p}}{}\mathcal {H}^l(R\pi _*\underline{\mathbb {Q}}_Y) \longrightarrow Rj_*{\mathfrak {p}}{}\mathcal {H}^l(R\pi ^U_*\underline{\mathbb {Q}}_U) \longrightarrow Ri_*{\mathfrak {p}}{}\mathcal {H}^{l}(R\pi _*^Z\underline{\mathbb {Q}}_Z[-1]) \longrightarrow 0.\) 
Finally, taking hypercohomology of this sequence on \(B\)  gives the required sequence.
The proof for exactness of the second sequence follows by applying an analogous argument to the second localization sequence from [2]}, or by applying Poincaré-Verdier duality.
