Unable to create membership
Did you recently merge Organization contact which was related to membership type? If yes than its a known error in CiviCRM. I always prefer to retain the contact linked to membership type or settings. Or another option to avoid this in future we have installed an extension on most of our client site.
Solution to fix the problem? Run below query to fix the price set data.
SELECT cpf.id, cpf.name, cmt.member_of_contact_id,  cpfv.membership_type_id
FROM civicrm_price_field cpf 
  INNER JOIN civicrm_price_field_value cpfv 
    ON cpfv.price_field_id = cpf.id 
  INNER JOIN civicrm_price_set cps 
    ON cps.id = cpf.price_set_id AND cps.name = 'default_membership_type_amount'
  INNER JOIN civicrm_membership_type cmt
    ON cmt.id = cpfv.membership_type_id;

-- Incase above query returned results with cpf.name &lt;&gt; cmt.member_of_contact_id than run below query.
UPDATE civicrm_price_field cpf 
  INNER JOIN civicrm_price_field_value cpfv 
    ON cpfv.price_field_id = cpf.id 
  INNER JOIN civicrm_price_set cps 
    ON cps.id = cpf.price_set_id AND cps.name = 'default_membership_type_amount'
  INNER JOIN civicrm_membership_type cmt
    ON cmt.id = cpfv.membership_type_id
SET cpf.name = cmt.member_of_contact_id;

HTH
Pradeep