Time Machine stopped backing up my Photos Library two years ago I recently had to restore a Mojave Mac Mini from Time Machine.  It all seems to go well until I discovered that the Photos Library was gone.  After looking through the TM backup, I see the last time it was backed up was 2018.  I did nothing I can imagine to exclude it. It's un-backed-up state is confirmed on a second off-site backup started in Feb of this year; the file simply does not exist.
There are no TM exclusion rules that would have prevented the file from being backed up.

I suppose I'm out of luck on a recent version of the file, but why would this have happened?  Unless I'm missing something, this brings into question whether TM is a viable tool for backups.
Update
I decided to take my lumps and restore the old library.  17 GB of data is better than none.  I did check the next time TM ran and it happily backed up the library!  Note that I did not change any settings.
This gives me great pause in relying on Time Machine for backups.  It archives many of the files on my disk, but if it misses even one, that is always going to be the one that you need.
Also of note, this is the only machine I administer that I don't use a belt-and-suspenders approach to backups.  All my other machines have at least one TM backup plus a bootable backup with Carbon Copy Cloner.  I just ran out of CCC licenses for this machine.
Time machine constantly takes snapshots of each file, this simply is a lot of data, and being conservative is important for the sake of the consumer's end. Harddrive reads and writes are expensive! Especially when it is the eventual cause for a harddrive to fail and a critical system backup is therefore lost on the consumer's end.
Apple offers ~/Pictures/Photos Library to be backed up to iCloud by default, and is cutting a corner for saving your backup. Time Machine also doesn't backup many large system files that apple deems a &quot;defaulted&quot; file from macOS and easily reclaimed from remote apple servers.
Unrelated side-note: You can argue 5GB of free iCloud Storage isn't enough for even the Photos library alone, and you're right. But its incentive for you to pay for their service.