In most industries, this is not a red flag at all. Nobody doing anything serious would let normal applicants look openly at their codebase.
You don't have to (and should not) request access to the whole codebase, simply asking to see a single medium sized file from a project you would be expected to work with is often enough. I've asked for this before with great success, some companies will ask you to sign a short NDA beforehand, most don't even bother. Sure, it leaves the chance that they will simply show you the pretty parts, but at least you'll know that there are some pretty parts at the very least.
Much of the time, the software isn't what makes for a great company - it's how that software makes the business work. A company can have the best code in the world, but if Uber had no cars, AirBNB had no houses, or Facebook didn't have your friends - they would be pointless.
I'm not sure if you're serious or not. A small company selling a proprietary software product ABSOLUTELY WILL NOT EVER UNDER ANY CIRCUMSTANCES show you their code before you've signed contracts.
I've never had someone ask this, but I would offer to let them browse some code and recent PRs on my laptop while I sit alongside.
If they won't comply, that means someone read their employment contract and non-disclosure agreements.