When manually upgrading Grid Infrastructure on an ODA according to MOS note 2379389.1 it has to be done as grid user. This can fail with OUI-10022 error which indicates that Oracle inventory is corrupt.
But when trying an “opatch lsinventory” as oracle and as grid user these commands succeeded, so inventory seems to be ok.
It turned out that the locks subdirectory of the oracle inventory was not writable for the grid user. After making it writable for user grid, upgrade ran fine.