Illegal storage access with nested dicts
### Description

I am working on a piece of code with nested dicts. It is odd but the code produces a segfault in a unittest test environment
Basically the core code resorts to:

```nim
test "ValueNetwork  4":
    var state = State(config: mockConfig)
    let a = {"B": 1.0, "C": 1.0, "D": 1.0}.toTable()
    let b = {"A": 1.0, "C": 1.0, "D": 1.0}.toTable()
    let c = {"A": 1.0, "B": 1.0, "D": 1.0}.toTable()
    let d = {"A": 1.0, "B": 1.0, "C": 1.0}.toTable()
    var valueNetwork = initTable[string, Table[string, float]]()
    valueNetwork = {"A": a, "B": b, "C": c, "D": d}.toTable()
```

Inside the unittest it creates illegal storage access but not inside an arbitrary file, i.e.

```nim
#some_file.nim
import std/tables
let a = {"B": 1.0, "C": 1.0, "D": 1.0}.toTable()
let b = {"A": 1.0, "C": 1.0, "D": 1.0}.toTable()
let c = {"A": 1.0, "B": 1.0, "D": 1.0}.toTable()
let d = {"A": 1.0, "B": 1.0, "C": 1.0}.toTable()
var valueNetwork = initTable[string, Table[string, float]]()
valueNetwork = {"A": a, "B": b, "C": c, "D": d}.toTable()
```

Not really sure what is causing the issue here since in another unittest I initialize it in a similar way and it runs without issues


### Nim Version

2.0.4

### Current Output

_No response_

### Expected Output

_No response_

### Known Workarounds

_No response_

### Additional Information

_No response_