Links inserted via rest api aren't displayed correctly

Hi there,

I tried to set certain links on a Confluence page via rest api in my forge app. This works fine if I set the links to display inline. However, when trying to insert display format card or embedCard, it looks like this for external links

and this for internal links to other Confluence pages

Bildschirmfoto 2021-12-29 um 17.10.48

Does anybody know what that means and how to fix it? When I update the content, the body looks exactly the same as when I read the page content. But the links are not displayed as cards correctly on the updated page.
Also the learn more link on the first screenshot doesn’t really help as it is pointing to this page: