Cannot read properties of undefined in angular even after value is available in template and getting printed

There is featureImages section in component.html which is throwing this error not sure why it is happening

news-section.component.ts:296 ERROR TypeError: Cannot read properties of undefined (reading ‘value’)
at NewsSectionComponent_div_1_div_4_div_1_Template (news-section.component.html:35:14)
at ReactiveLViewConsumer.runInContext (core.mjs:10425:13)
at executeTemplate (core.mjs:10968:22)
at refreshView (core.mjs:12489:13)
at detectChangesInView (core.mjs:12653:9)
at detectChangesInEmbeddedViews (core.mjs:12597:13)
at refreshView (core.mjs:12513:9)
at detectChangesInView (core.mjs:12653:9)
at detectChangesInEmbeddedViews (core.mjs:12597:13)
at refreshView (core.mjs:12513:9)

Getting this error for a property when a user click on like button, but not on initial page load.
Also like button has a different function which is not related to initial page loading function

 featuredImages = [];
  featureNids = [];

  constructor(
    private restService: RestService,
    private gtmService: GtmService,
    private jsonApiService: JsonApiService,
    public hubService: HubDataService,
    private http: HttpClient,
    public router: Router
  ) {}

  ngOnInit() {
    this.getStoriesToDisplay();
  }

  public getStoriesToDisplay() {
    // Try to pull from saved articles
    const index = this.newsFilterOptions.indexOf(this.currentOption);
    if (this.savedResults[index] && this.savedResults[index].length > 0) {
      this.storiesToDisplay = this.savedResults[index];
    } else {
      let restType;
      if (this.currentOption === 'Current') {
        restType = RestServiceType.GlobalNews;
      } else {
        restType = RestServiceType.GlobalNewsCategory + this.currentOption;
      }

      const responsePromise = this.restService.getPagedJsonApiContent(
        window.location.protocol + '//' + window.location.host,
        restType,
        this.amountToShow,
        0
      );

      responsePromise.then((resp) => {
        if (!resp.ok) {
          return Promise.reject(resp.statusText);
        } else {
          this.http
            .get('/get-featured-news-data?_format=json')
            .subscribe((res) => {
              if (Object.values(res)?.length > 0) {
                let sortedItemIds = Object.values(res);
                let splitedArray =
                  sortedItemIds[0]['field_top_featured_news'].split('+');
                splitedArray = [...new Set(splitedArray)];
                let topFeaturedNews: string = res[0]['field_top_featured_news'];
                this.http
                  .get(
                    '/get-featured-news-details-rev/' +
                      topFeaturedNews +
                      '?_format=json'
                  )
                  .subscribe((res) => {
                    if (Object.values(res['rows'])?.length > 0) {
                      const obj = {};
                      this.featuredImages = res['imagerows'];
                      console.log('this.featureImages', this.featuredImages);
                      Object.values(res['rows']).forEach((o: any) => {
                        obj[o.nid[0]['value']] = o;
                      });
                      // sorted according to added from back-end
                      let sortedFeaturedNewsList = splitedArray.map((e) =>
                        Object.assign({}, obj[e])
                      );
                      // remove the empty object if it is unpublished news
                      sortedFeaturedNewsList = sortedFeaturedNewsList.filter(
                        (value) => Object.keys(value).length !== 0
                      );
                      for (let i = 0; i < Object.values(res)[0]?.length; i++) {
                        this.featureNids.push(
                          Object.values(res)[0][i].nid[0]['value']
                        );
                      }
                      this.fnLoaded = true;
                      this.featurednewstoDisplay.push(sortedFeaturedNewsList);
                      this.featuredStoriesToDisplay =
                        this.featurednewstoDisplay[0];
                      console.log('this.featuredStoriesToDisplay', this.featuredStoriesToDisplay);
                      if (this.featuredStoriesToDisplay?.length > 0) {
                        let ids = this.featuredStoriesToDisplay
                          .map((a) => a.nid[0]['value'])
                          .map((i) => Number(i));
                        this.story(resp, index, ids);
                      } else {
                        this.story(resp, index);
                      }
                    } else {
                      this.story(resp, index);
                    }
                  });
              } else {
                this.story(resp, index);
              }
            });
        }
      });
    }
  }

Function called on like button

  toggleLike(userId: string, featurednews): void {
    if (featurednews && featurednews.nid) {
      if (this.isLikedBy(userId, featurednews.field_users_that_liked)) {
        // remove current user like
        let i = 0;
        while (i < featurednews.field_users_that_liked.length) {
          if (featurednews.field_users_that_liked[i].value === userId) {
            featurednews.field_users_that_liked.splice(i, 1);
          }
          i++;
        }
      } else {
        featurednews.field_users_that_liked.push({ value: userId });
      }
      // featurednews.nid = featurednews.nid[0].value;
      if (featurednews.nid[0] === undefined || featurednews.nid[0] === null) {
        featurednews.nid = featurednews.nid;
      } else {
        featurednews.nid = featurednews.nid[0].value;
      }

      let usersThatLiked = [];
      featurednews['field_users_that_liked'].forEach((element) => {
        usersThatLiked.push(element);
      });
      featurednews.usersThatLiked = usersThatLiked;
      this.restService.getRestSessionToken().subscribe((token) => {
        const requestBody = JSON.stringify(featurednews);
        this.restService
          .patchResource(
            `${RestServiceType.NodeData}${featurednews.nid}?_format=json`,

            requestBody,
            token
          )
          .subscribe();
      });
    }
  }

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật