We construct pairs of residually finite groups with isomorphic profinite completions such that one has non-vanishing and the other has vanishing real second bounded cohomology. The examples are lattices in different higher-rank simple Lie groups. Using Galois cohomology, we actually show that
$\operatorname {SO}^0(n,2)$
for
$n \ge 6$
and the exceptional groups
$E_{6(-14)}$
and
$E_{7(-25)}$
constitute the complete list of higher-rank Lie groups admitting such examples.