The cookie banners were never mandated by GDPR, that's entirely the industry's fault and intent - dark UX patterns to try and annoy the user into agreeing, or a silent protest to the perceived overbearing nature of the GDPR.
They could've just respected a browser's do-not-track header but chose not to. The EU legislators should've done that too, that is, dictate a standardized method for people to opt in.