Thank you so much @ragavanrajan ! Resetting the portal worked like a charm, at least for the SharePoint integration. You saved my day 🙂
The problem with the Script error still remains. I can't change some of the Form options in the Portal Management App either. Additionally, when I want to create Basic Form Meta Data, there is a similar script error but with a different error message (I can't create Basic Form Meta Data for Portal B):

Web resource method does not exist: adx.xrm.webForms.entityFormMetadata.type.onChange. However the closest object we found is adx that contains these properties: resources. Please verify this object is not corrupt and is not an object of the same name defined elsewhere, such as another script.
Session Id: dbd8eede-48c2-44e7-924a-7bf392b56467
Correlation Id: 6210015c-198c-4958-ad89-a7b1cdd59b9f
Event Name: onchange
Function Name: adx.xrm.webForms.entityFormMetadata.type.onChange
Web Resource Name: adx_webforms/adx.xrm.webforms.handlers.js
Solution Name: MicrosoftPortalTimeline
Publisher Name: adxstudio
Time: Tue Nov 29 2022 08:42:16 GMT+0100 (Central European Standard Time)
It seems to me that something broke when Portal A was automatically deleted.