Here's a peek at what the ticket.db inside the 11.5.0-38U_ctrtransfer_o3ds.bin from the guide looks like (you can check this yourself by getting CDN-FX, as well):
(Note that all the tickets with a console ID of 00E74E01 here were legit tickets from legitimate purchases made by the owner of the 3DS from which this CTRTransfer image came from.)
If you mount this ticket.db in GM9, you'll find that only a fraction of these actually show up (something everyone here can also verify, as well):
Note that GM9 only displays tickets which are properly signed by Nintendo. Any changes to a ticket invalidates the signatures, and thus they won't show up in GM9.
If you look inside the ticket.db in a hex editor, at 0x1E2818 you can find a ticket for Super Mario Bros. VC. This ticket looks complete, but the eShop account ID has been zeroed out by the system. At 0x13AAC10, you can find another ticket for Super Mario Bros. VC, this one has been partially overwritten (half of the signature is missing.)
If you scroll around in this area, you can see a handful other tickets that have been partially overwritten in that way, mixed in between a few tickets that are complete. I haven't looked through the entire file to find all examples (waste of time), but you get the point.
(PS:
do not upload your ticket.db here for people to look at; it contains all of your tickets, including all of your legitimate tickets, which should not be shared here because they could be used by anyone for downloading through ctrcdnfetch. This could also get your 3DS banned if Nintendo notices too many downloads from all over the world using your tickets, or if DLC you didn't buy is being downloaded. If they don't just invalidate your tickets altogether, but I'm not sure if they would do that.)
Point is, tickets getting partially overwritten is normal functioning of the system. The console doesn't care about what is in ticket.db aside from the tickets which are currently in use (it will not overwrite tickets which have not been marked as deleted, either.) FBI may be able to tell currently active and undeleted tickets apart from the inactive/duplicate ones (it can display them, after all, and hide them once you "delete" them), but GM9 doesn't have access to all the ARM11 functions that FBI does; all it can do is parse the contents of ticket.db directly.
Homebrew authors don't know all the inner details of how the system works, only Nintendo does. I mean, I guess it could be possible for someone to disassemble all of the system files to figure out
exactly how everything works and document everything, but this would be a huge waste of time given that we can already achieve everything that actually matters by just using Nintendo's built-in functions, with minimal effort.
Furthermore, I am going to repeat myself: the eShop re-downloads and re-installs all missing tickets (or corrupted tickets, sure, why not) for your purchased content when you enter it, if it detects that the currently active ticket for these titles is not the one from your eShop account/NNID. This is easily verifiable by restoring a ticket.db (or a complete nand backup) which did not have the tickets for one or more of your downloads, and entering the eShop.
This is also why pirated DLC may disappear when you enter the eShop. Simply accessing a game's DLC shop (or the Theme shop) will grant your account a legit DLC ticket for it. It will also show up in data management, though it doesn't actually contain any of the DLC.
If you installed pirated DLC afterwards, upon visiting the eShop later, it notices that the ticket currently in use for this title is not the one from your eShop account, and it overwrites it. The only way to stop this from happening is to delete your eShop account or unlink your NNID, if all of the purchases and DLC shop accesses were made with an NNID. Though note that by deleting your eShop account, you will of course lose all of your purchases, so this is not something anyone should do lightly (you won't lose anything if you only have to unlink your NNID, though you won't have access to your stuff while your NNID is unlinked either.)
tl;dr this is fine, you have nothing to gain from replacing your ticket.db and reinstalling your tickets, you would only be wasting your time if you did so.
Especially if nothing is actually malfunctioning on your system while you're using it (all games and system titles functional, etc.) The issue was with GM9's improper handling of tickets, because we don't know exactly how everything in ticket.db works, so it can be difficult (impossible) for GM9 to tell exactly which ticket is the current one in use given that it doesn't have access to all the ARM11 functions that FBI does to differentiate between tickets.
GM9 should not fail to build working CIAs past the October 23 2018 commit. A CIA is
basically a ticket, a tmd, and contents. The TMD and contents are as-is on SD, there is no way for GM9 to get that wrong. As for the ticket, it has to scan through ticket.db and find the relevant information in there. This should not fail with the newer commits, because GM9 uses a pre-constructed ticket, with only the title key and title ID being replaced with data from ticket.db (technically also the common keyY, but fake tickets from cdn downloaders don't seem to care about that and it worked just fine for them regardless.) As long as 0x140-0x1BB (issuer) and 0x1DC-0x1E3 (titleID) in a ticket GM9 detects within ticket.db are intact (which they always should be, if GM9 is detecting it as being a ticket for your title), 0x1BF-0x1CE (title key) is necessarily also intact, meaning that any data detected by GM9 within ticket.db as being a ticket for your title will result in a proper fake ticket being built. Though note that if a duplicate ticket had a wrong title key, this could still result in your built CIA having the wrong title key, but this should not cause any problems because the title key is only used when downloading from the eShop/CDN, and since you can't download from the CDN anymore without having a completely valid signed ticket, it doesn't really matter if your custom-built CIAs have an incorrect title key (it only matters for CIAs generated from CDN content.)
The only reason anyone would want to replace their ticket.db with a clean one to remove all traces of past tickets, is if they're really obsessed with keeping everything as "clean" and "proper" as possible (note: I am; I've got an old backup with a relatively clean ticket.db that I've restored more than once to several different 3DSes, because I have an unhealthy obsession with keeping everything as "clean" and "proper" as possible. I'm still kicking myself for not making a clean factory backup of my 2DS when I got it, lol.) This is of course a waste of time though, because your 3DS will work just fine even if the ticket.db isn't completely empty of old ticket remnants, and Nintendo doesn't scan the contents of your ticket.db for detecting traces of homebrew/CFW usage either.