Custom doctype missing after bench restore


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/", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/", line 83, in execute_cmd
    return, **frappe.form_dict)
  File "apps/frappe/frappe/", line 1581, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/", line 74, in getdoctype
    docs = get_meta_bundle(doctype)
  File "apps/frappe/frappe/desk/form/", line 85, in get_meta_bundle
    bundle = [frappe.desk.form.meta.get_meta(doctype)]
  File "apps/frappe/frappe/desk/form/", line 45, in get_meta
    meta = FormMeta(doctype)
  File "apps/frappe/frappe/desk/form/", line 56, in __init__
  File "apps/frappe/frappe/desk/form/", line 66, in load_assets
  File "apps/frappe/frappe/desk/form/", line 121, in add_code
  File "apps/frappe/frappe/desk/form/", 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'"