sharepoint online – Two search Web Parts on the same site do not work (only on the same page)

I have two parts search web. They are based on each other, that is, they do pretty much the same thing with less important changes. They have different product IDs and aliases. Only the code is similar.

The problem is that I can not run both Web Parts. If I put one of the Web Parts in one page and the other on a different page of the same site, it does not work. It does not work if I put the Web part in a subsite too. It works in the online workbench.

In console I get the following error:

Uncaught error (in promise): Error while querying HttpClient in the request object [404] ::>

The code I have for my research

    import {WebPartContext} from "@ microsoft / sp-webpart-base";
import pnp, {SearchQuery, SearchQueryBuilder, SearchResults, SearchResult
from '@ pnp / pnpjs';

ProjectItemProvider export class {
private context: WebPartContext;

constructor (context: WebPartContext) {
this.context = context;

public GetSiteItemsByContentId (contentTypeId: string, selectProperties: string[]): To promise {
const _searchQuerySettings: SearchQuery = {
TrimDuplicates: false,
RowLimit: 500,
SelectProperties: selectProperties.concat (["ParentLink"])

let q = SearchQueryBuilder (`ContentTypeId: $ {contentTypeId} *`, _searchQuerySettings) .rowLimit (500);
const srPromise = new promise((solve, reject) => { (q) .then ((answer: SearchResults) => {

resolve (answer.PrimarySearchResults);
returns srPromise;

Maybe it's the context that spoils it? If so, what could I do about it?