This error is due to wrong entries of ORACLE_HOME in the inventory location. To fix this.
cd $ORACLE_HOME/oui/bin
oracle@dbhost1:...roduct/12.1.0/dbhome_1/oui/bin$ ./attachHome.sh
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 375400 MB Passed
The inventory pointer is located at /var/opt/oracle/oraInst.loc
'AttachHome' was successful.
Now run opatch lsinventory command, it should work fine.