How to add journal entry for company's shares?

I’m trying to add journal entry to add company shares to owner but it doesn’t work…
I’m following Managing Company Shareholders - #4 by kid1194
But when I click Submit on Journal Entry I get error

Party Type and Party can only be set for Receivable / Payable account
Capital Stock

This error looks like to be caused by fix: Validate party on non receivable / payable account by Karuppasamy923 · Pull Request #44883 · frappe/erpnext · GitHub

Capital Stock account type is “Equity”. So how am I supposed to do this?

It looks like issue is that it’s not possible to manually add such journal entries using New Journal Entry form. But when going thru New Share Transfer form first. Submitting that and then clicking Create Journal Entry then it works correctly.