We get this "Schengen" hassle on a daily basis here in Gibraltar when crossing the frontier in and out of Spain
As Asurias said, the hassle you have with Spain has nothing to do with Schengen or even the EU, since GIB was never in the EU, and even not with the UK , as they opted out of the Schengen treaty in 1990, so long before Brexit.
What never ceased to amaze me with my British colleagues and friends is that they always had themselves strict border controls themselves , even before Brexit , but now after Brexit they still expect to cross the EU borders freely as before. As a recent French Foreign minister said : "
the British people have to realize that the border between UK and the EU is now the same border as Poland with Belarus , or Estonia with Russia ".