I followed these directions on my Mac but was only able to retrieve a few messages. I don't get why some are saved and others aren't.
The Messages application is confusing because it is a gateway to two entirely different messaging systems, Apple's proprietary iMessage and your cellular phone provider's SMS/MMS messaging network, and each has its own rules. iMessage is the default if it is available and both parties have an Apple ID and are signed in to Message and Facetime. iMessages are end to end encrypted and although they may be stored on iCloud cannot be read by Apple and have several
glamour features such as memoji. SMS/MMS texts travel through the telephone provider's network using your cellular telephone number.If you look at a
conversation in Messages and your texts are in a
green bubble then it is an SMS/MMS. If your texts are in a
blue bubble then it is an iMessage. I suspect the messages you are not finding are SMS/MMS messages and the ones you are seeing are iMessages.
There is a setting in Messages > Preferences > General about how long to keep messages, you might want to check that and see what it is set for.
When I have critical text conversations, I print them as PDF and save them in a
DEVONThink or
Yojimbo database. You can even capture FaceTime conversations as screen recordings and save those into the same database. It is a great way to keep business records.