Gutenberg RichText

Please paste the full code, According to official Gutenberg button block. You need to have additional block attributes to use for button link,text –

https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/button/index.js

<RichText.Content
    tagName="a"
    className={ linkClass }
    href={ url }
    title={ title }
    style={ buttonStyle }
    value={ text }
/>

As you can see, there’s a URL, Title & Text attributes.

url: {
        type: 'string',
        source: 'attribute',
        selector: 'a',
        attribute: 'href',
    },
    title: {
        type: 'string',
        source: 'attribute',
        selector: 'a',
        attribute: 'title',
    },
    text: {
        type: 'array',
        source: 'children',
        selector: 'a',
    },

error code: 523