Numeric keypad on mobile device for numeric form fields - PHP Snippet 403 error

I am trying to add the following code as a PHP snippet however I am always getting a 403 forbidden error. This is happening on different test sites as well.

Do you know what may be the cause in the code?

// Open numeric keypad on mobile for number and quantity fields.
add_filter( 'gform_field_content', function( $content, $field, $value, $lead_id, $form_id ) {

    if ( wp_is_mobile() && ( $field instanceof GF_Field_Number || $field instanceof GF_Field_Quantity  ) ) {
        $content = str_replace( "type='", "inputmode='decimal' type='", $content );
    }

    return $content;

}, 10, 5 );

I can save the snippet in my test site without issues.

A 403 error is a server side error meaning the server is blocking the request (to save the snippet) for some reason. You will want to reach your host support about this.