PSU 3.6.4: Exception calling "Fill" with "1" argument(s): "There is an already an open DataReader associated with this Command which must be closed first."

Product: PowerShell Universal
Version: 3.6.4

Every once in a while we alter the autocomplete we get the pictured error. It is hard to reproduce.

We did remove the IF condition before opening in step1

if ($connection.state -ne 'Open') {
    $Connection = Connect-GacAFdbConnectionString -CString $ENV:sqlconnect
    $Connection.Open()
}

...And we would close in each step...

if ($connection.state -eq 'Open') {
    $Connection.Close()
}

we then replaced the above with the below:

New-UDStep -Label 'Step 1' -OnLoad {
    $Session:connection = Connect-GacAFdbConnectionString -CString $ENV:sqlconnect
    $Session:connection.Open()
....

and the -OnFinish {

.
.
.
$Session:connection.Close()