Any guesses what caused this
99.9% certain it's glue residue as you already suspected.
You can remove excess glue basically at three stages, almost immediately when it's fully liquid, after it has gone off a bit and is sort of rubbery and much later after full hardening. IMO the first and third options are the best, but plenty of people do it the second way and seem to get on well with it.
If you wipe up glue wet it's vitally important to be thorough and methodical and go over any areas more than once. Also use warm water if it's available as it helps a lot.
You've already found one of the previous Q&As that covers this topic but I'll link to it here for future searchers, Glue spots under stain.
how to fix it.
Sorry to say but the only way to properly fix this this sort of thing is to go back to the beginning. Remove enough from the surface ply planing, sanding or scraping (or using any combination of the three) that you get down to bare wood and then re-colour.
You can try to 'spot' lighter areas like this, basically touch them up with a fine brush using a coloured varnish1, coloured or tinted shellac, tinted lacquer, or thinned oil paints, but it's challenging to make this sort of touch up blend seamlessly in terms of colour, and also very difficult not to end up with the retouches being slightly raised which you can often clearly make out in the reflections from the surface even after a few coats of finish.
'Previewing' stain coverage
You can find whether you'vee accidentally missed some glue during cleanup before applying stain by wiping the wood with mineral spirits/white spirit. Any areas with a smear of glue2 will show up pale, with the unaffected wood going darker.
If you do this and see no problems wait for the spirits to fully evaporate before continuing.
1 This includes "gel stain" which is a coloured varnish with a gelled consistency.
2 Or where glue has soaked into the surface and you haven't scraped or sanded enough to get beneath it