
**Describe the bug**
An internal error occurs when executing a `NATURAL RIGHT JOIN` between two tables, where the `RIGHT JOIN` works correctly.

**To Reproduce**

```sql
CREATE TABLE t0(c0 INT); 
CREATE TABLE t1(c0 VARCHAR);

SELECT * FROM t1 RIGHT JOIN t0 ON t1.c0 = t0.c0; -- empty table
SELECT * FROM t1 NATURAL RIGHT JOIN t0;
-- Error in optimizer multiplex: TypeException:user.main[19]:'calc.ifthenelse' undefined in:     X_139:any := calc.ifthenelse(X_133:bit, X_135:int, X_137:str);
```

**Expected behavior**
Empty table or handling the error gracefully

**Screenshots**
N/A

**Software versions**
Build from source:

```
> docker exec -it monetdb-test mserver5 --version         
MonetDB 5 server 11.50.0 (hg id: 2d9ea21) (64-bit, 128-bit integers)
This is an unreleased version
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2023 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 503.5GiB available memory, 128 available cpu cores
Libraries:
Compiled by: @20410e6e122d (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc 
Linking    : /usr/bin/ld
```

**Issue labeling**
Bug

**Additional context**
Add any other context about the problem here.
Unexpected error when using `NATURAL RIGHT JOIN`
This is a GitHub Issue
repo:MonetDB
owner:MonetDB
Title : Unexpected error when using `NATURAL RIGHT JOIN`
Issue date:

--- start body ---

**Describe the bug**
An internal error occurs when executing a `NATURAL RIGHT JOIN` between two tables, where the `RIGHT JOIN` works correctly.

**To Reproduce**

```sql
CREATE TABLE t0(c0 INT); 
CREATE TABLE t1(c0 VARCHAR);

SELECT * FROM t1 RIGHT JOIN t0 ON t1.c0 = t0.c0; -- empty table
SELECT * FROM t1 NATURAL RIGHT JOIN t0;
-- Error in optimizer multiplex: TypeException:user.main[19]:'calc.ifthenelse' undefined in:     X_139:any := calc.ifthenelse(X_133:bit, X_135:int, X_137:str);
```

**Expected behavior**
Empty table or handling the error gracefully

**Screenshots**
N/A

**Software versions**
Build from source:

```
> docker exec -it monetdb-test mserver5 --version         
MonetDB 5 server 11.50.0 (hg id: 2d9ea21) (64-bit, 128-bit integers)
This is an unreleased version
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2023 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 503.5GiB available memory, 128 available cpu cores
Libraries:
Compiled by: @20410e6e122d (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc 
Linking    : /usr/bin/ld
```

**Issue labeling**
Bug

**Additional context**
Add any other context about the problem here.
--- end body ---

None