I have had this problem since upgrading my 2014 iMac to macOS Catalina. I didn't pursue it any further, because I knew I would be purchasing a new 2019 iMac.
I had finally finished setting up the new iMac and was disappointed to see the exact same problem occur.
I contacted Apple support and he had me do numerous things to include deleting the DB files.
I know that there have been some major file permissions changes with the new macOS. I have all of my photos on an external photos hard drive. When exporting, I also export to a folder on that drive.
I decided to export a jpg to the downloads folder on the internal drive of my iMac.
I can now message and send a jpg from my iMac ONLY if I am messaging a photo located on the internal drive. It's not a perfect fix, but it's better than nothing.