## Summary
<!--Explain briefly what goes wrong and explain why you believe this is a bug and not the intended behavior of SQLite (if it is not a crash).-->**No review yet**

## Minimized query

```sql
ATTACH DATABASE ':memory:' /* min({v}, 1, 2, 3) */ AS aux83;
ATTACH DATABASE ':memory:' AS aux79;
CREATE TABLE t1(a INTEGER, b INTEGER PRIMARY KEY, c BLOB, FOREIGN KEY (b) REFERENCES t2);
CREATE TABLE t2(c, d, e);
INSERT INTO t1 VALUES(json_valid(json_insert(NULL, '$[0]', rtrim(1)), 8), 2, 3);
ALTER TABLE t1 RENAME COLUMN b TO d;
CREATE TABLE t3(a, b, c, d, e, f, g, h, i, j, k, l, m, FOREIGN KEY (b, c, d, e, f, g, h, i, j, k, l, m) REFERENCES t4);
CREATE TABLE t4(x, y, z);
INSERT INTO t4 VALUES(3, 2, 1);

DETACH DATABASE aux79;
DETACH DATABASE aux83;
PRAGMA temp_store_directory;
REINDEX t1;
INSERT INTO t2 VALUES (NULL, NULL, NULL);
DELETE FROM t1 WHERE c IS NULL RETURNING *;
```

## Actual output

```sql
Parse error near line 5: wrong number of arguments to function json_valid()
  INSERT INTO t1 VALUES(json_valid(json_insert(NULL, '$[0]', rtrim(1)), 8), 2, 3
                        ^--- error here
```

## Expectation

```sql

```

## Flag

```

```

