Custom doctype missing after bench restore

Hi.

I’ve used bench restore and found that most of my custom doctypes are missing.

Strangely, the doctypes are showing in doctype list, however they are unusable and throw the error below when trying to open them in list view.

Looking at the files in vscode, it seems like during the restore the folder structure isn’t created for them in apps>erpnext>erpnext>accounts>doctype. I’m able to fix this by editing the doctype (making some small change in the erpnext doctype gui) and then saving it. This then generates the file structures needed in the backend.

Does anyone have any experience with this problem? Am I missing a step to restore my custom doctypes correctly?

Error that pops up before doctype edited and folder structure generated.

### App Versions

{
	"erpnext": "14.0.0",
	"frappe": "14.0.0",
	"payments": "0.0.1"
}

### Route

List/Lease Agreement/List

### Trackeback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1581, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/load.py", line 74, in getdoctype
    docs = get_meta_bundle(doctype)
  File "apps/frappe/frappe/desk/form/load.py", line 85, in get_meta_bundle
    bundle = [frappe.desk.form.meta.get_meta(doctype)]
  File "apps/frappe/frappe/desk/form/meta.py", line 45, in get_meta
    meta = FormMeta(doctype)
  File "apps/frappe/frappe/desk/form/meta.py", line 56, in __init__
    self.load_assets()
  File "apps/frappe/frappe/desk/form/meta.py", line 66, in load_assets
    self.add_code()
  File "apps/frappe/frappe/desk/form/meta.py", line 121, in add_code
    self.add_html_templates(path)
  File "apps/frappe/frappe/desk/form/meta.py", line 134, in add_html_templates
    for fname in os.listdir(path):
FileNotFoundError: [Errno 2] No such file or directory: 'apps/erpnext/erpnext/accounts/doctype/lease_agreement'


### Request Data

{
	"type": "GET",
	"args": {
		"doctype": "Lease Agreement",
		"with_parent": 1,
		"cached_timestamp": null
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.load.getdoctype"
}

### Response Data
{
	"exception": "FileNotFoundError: [Errno 2] No such file or directory: 'apps/erpnext/erpnext/accounts/doctype/lease_agreement'"
}