Recently, I came across a situation where rpm fails to install saying the requested rpm is already installed, but on querying the installed rpm's list it doesn't shows as installed.
Ended up searching for cleaning the rpm db cache and below command worked for me
- Move the existing database files /var/lib/rpm/_db* to another location for backup
rpm --rebuilddb