Did sample test.
The script would get data from another site collection while there is potential issue, SPFx use current user credential to access SharePoint data, so if current user has no permission to target site collection, there would be issue.
this.props.context.spHttpClient.get(`https://xxx.sharepoint.com/sites/modernteam/_api/web/lists/getbytitle('List1')/items?select=ID,Title`,
SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => {
response.json().then((responseJSON: any) => {
// to do
});
});
So, you may consider to use search/Microsoft graph instead.
Search in SPFx
Call graph api in SPFx