You cannot select the account “Inventory on hand” anymore in Journal Entries.
What you have made is more or less how Starting balances of Inventories are supposed to be entered, in fact, your method makes more sense than the advised method.
Just make sure to make the Supplier “Opening Stock/Inventory Balance” inactive so it doesn’t interfere with your day to day entries.
Having said that, a better way still, is to use a Zero Value Payment as follows: