Exception in Sandbox and looping continuously

The second issue is due to a bug in the duplicate contract key detection. This is fixed in SDK 1.11.2 or 1.13.0 and newer.

The same bug can also result in “DuplicateKeys” error being reported as “InconsistentKeys” so the first is either a race on a contract key leading to an actual InconsistentKeys error or a DuplicateKeys error meaning you tried to create a contract with a key that already exists. Given that it’s the same bug, it’s also the same fix so I recommend upgrading to at least 1.11.2.