I think the total number of code-names grids possible is something like 210 344 706 000, so the 40 cards (plus 4 rotations, so 160 possible grids) are only a tiny, tiny fragment of those possible. But it does mean that defeating the bot would only mean creating a custom grid, which sounds very practical virtually, and possible (but harder) in person.
I did a quick search, and there are generators that I guess you bring up on your phone, like so: https://code-names.netlify.app
- You can generate grids on multiple devices with a seed
- If the phone displaying the grid falls over, it automatically hides the grid.
I don't know if the grids in the app are truly random or if they follow some constraints though.