You forgot to mention that the bank has $100,000 cash and a debt instrument (asset) that is worth more than $400,000 on its balance sheet after writing the $500,000 check to the seller.
Also, the question was ‘How does the government print money?’ and not ‘How does a bank lend money?’
Also, the question was ‘How does the government print money?’ and not ‘How does a bank lend money?’