How to obtain a unique node field in a customized way

I have a custom form in which the reference field should be displayed.

Here is the structure:
Type of content: Project

Reference field in the type of content of the project:
POD Details (Fields- Member Name: User Reference, Member Function: Reference Taxonomy Term)

How can we obtain fields for the type of Project content with its widget in a personalized way?

This is what I have tried:

The ProjectFormAlter class extends FormBase {

/ **
* {@inheritdoc}
* /
public function getFormId () {
returns & # 39; member_form & # 39 ;;
}

/ **
* {@inheritdoc}
* /
public function buildForm (array $ form, FormStateInterface $ form_state) {
$ entity =  Drupal :: entityManager () -> getStorage (& # 39; paragraph & # 39;) -> create (['type' => 'pod_infromation']);
$ form_state-> set (& # 39; paragraph & # 39 ;, $ paragraph);
$ form_display =  Drupal :: entityManager () -> getStorage (& # 39; entity_form_display & # 39;) -> load (& # 39; paragraph.pod_infromation.default & # 39;);
$ form_state-> set (& # 39; form_display & # 39 ;, $ form_display);
foreach ($ form_display-> getComponents () as $ name => $ component) {
$ widget = $ form_display-> getRenderer ($ name);
if (! $ widget) {
continue;
}
$ items = $ entity-> get ($ name);
$ items-> filterEmptyItems ();

$ form[$name] = $ widget-> form ($ items, $ form, $ form_state);

$ form[$name]['#access']    = $ items-> access (& # 39; edit & # 39;);
$ form[$name]['#access'];
$ form['#parents'] = [];
}
returns $ form;
}

/ **
* {@inheritdoc}
* /
public function validateForm (array & $ form, FormStateInterface $ form_state) {

}

/ **
* {@inheritdoc}
* /
public function submitForm (array & $ form, FormStateInterface $ form_state) {
}

}

Also, I am receiving an error with the previous code as:

TypeError: argument 1 passed to Drupal Core Field WidgetBase :: getWidgetState () must be of type array, given the null value

Any suggestion or roadmap that the node field can get in my custom form.

The links that I followed for this are below.

  1. https://www.webomelette.com/how-render-entity-field-widgets-inside-custom-form-drupal-8
  2. https://hotexamples.com/examples/drupal.core.field/FieldItemListInterface/setValue/php-fielditemlistinterface-setvalue-method-examples.html
  3. https://www.foreach.be/blog/how-select-fields-entities-forms
  4. https://www.drupal.org/forum/support/module-development-and-code-questions/2015-09-05/drupal-8-equivalent-to-field_attach#comment-11278197