There is a point which confuses me about BRST procedure. One shows that, if we define physical states as the ones that are annihilated by BRST charge $Q$, the scattering amplitudes don't depend on gauge fixing function. But doesn't charge $Q$ depend on the auxiliary field $B$, and therefore (after integrating it out) on gauge fixing function?
The short answers are:
Yes, the non-minimal BRST charge $Q$ does depend on the Lautrup-Nakanishi (LN) auxiliary field $𝐵$.
No, the BRST charge $Q$ does not depend on the gauge-fixing condition (which instead is part of the gauge-fixing fermion $\psi$).
One of the benefits of the BRST formalism, is that it shows formally that the path integral $Z$ doesn't depend on the gauge-fixing fermion $\psi$, cf. e.g. this post.
Integrating out the $B$-field implies that $Q^2$ only vanishes on-shell. However, integrating out fields cannot spoil the gauge-fixing independence of pt. 3.