500 Server Error - NullPointerException from REST API when saving custom content in atlas_doc_format format with inlineExtension node inside

I’m getting following server error:

{"statusCode":500,"data":{"authorized":false,"valid":true,"errors":[],"successful":false},"message":"com.atlassian.confluence.api.service.exceptions.ServiceException: java.lang.NullPointerException"}

When posting following payload to POST /wiki/rest/api/content method:

{
    "type": "ac:addon-key:custom-type",
    "space": {
        "key": "WTC"
    },
    "title": "Test content",
    "body": {
        "atlas_doc_format": {
            "value": "{\"version\":1,\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Test content\"}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"inlineExtension\",\"attrs\":{\"extensionType\":\"my_addon_macro\",\"extensionKey\":\"my_addon_macro_key\",\"parameters\":{\"test\":\"test\"}}}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Test content\"}]}]}",
            "representation": "atlas_doc_format"
        }
    }
}

Everything works fine (content is saved, 200 status response) when there’s no inlineExtension node inside the content.

Unfortunately with inlineExtension embedded, I’m getting following status 500 response. I’m using inlineExtension together with Atlaskit editor which uses ADF and supports this kind of node when it comes to rendering (see image below). But I cannot save it. Is there some problem with the way I’ve structured payload, or it is a bug?

This is how inlineExtension is rendered in Atlaskit editor:
image