UDButton in grid only works first time?

This is a real headscratcher for me, because the code in the UDbutton seems pretty simple.
If I replace the code inside the modal with a simple Card with a title, there is no issue.

I have a button in a grid, the grid has a column called DepartmentNumber, populated with a number on all lines.
Hitting the button a line, displays a modal with a list of employees in that department.
Hitting the button a second time, on the same line, yields the error at the bottom.

Any ideas is welcome.

New-UDButton -Text "More" -OnClick (
     New-UDEndpoint -Endpoint {
          $Employees = Get-ADUser -Filter "Department -like '$($ArgumentList[0])*'" -Properties Title,Department,WWWHomePage | Select-object -Property Name,SamAccountname,Title,Department,WWWHomePage

           Show-UDModal -Header {
                New-UDHeading -Size 4 -Text "Employees in $($ArgumentList[0])"
                 } -Content { 
                      New-UDgrid -Title "Account Details" -Headers @("Username", "Name", "Title", "Department", "DepartmentFriendlyName") -Properties @("SamAccountname", "Name", "Title", "Department", "WWWHomePage") -DefaultSortColumn "Name" -PageSize 8 -Endpoint {
                           $Employees | Out-UDGridData
                           }
                      }
                 } -ArgumentList $($_.DepartmentNumber)
) 

Edit: in 2.4.0 release, this is broken entirely - will look at fix and update if its still an issue

Still an issue in 2.4.0 release, but not as frequent, and with another error: