I’ve reported this to keepass and this was a reply from a maintainer -
I also reported this on Kubuntu forums but no feedback yet. Flatpak, the repository, Ubuntu version, and Snap all do the same thing. Hopefully, there will be some kind of fix soon. I use the custom icon feature a lot and it’s annoying having to look for a picture in the file manager first to get the file name and then locate it inside Keepass. The only other way to do it is open each file with a viewer to see what it looks like first which is completely out of the question.