You may be wrong with the assumption 0 isn't Workset1, since Workset1 is perhaps the first such created upon activating work sharing:
Workset1, 0
Cost Report Settings, 1
Area and Volume Computations, 2
Schedule Keys, 3
Project Info, 4
Render Settings, 5......
Shared Levels and Grids, 182...
Family : Planting : Planting_RPC_Tree_Deciduous, 325
Family : Windows : Windows_Sgl_Plain, 326
Family : Detail Items : Detail_Items_Suspended_Ceiling_Tile_Sec, 327
Family : Structural Framing : UB-Universal Beams, 328
Family : Structural Columns : UC-Universal Columns-Column, 329
Family : Title Blocks : Title_Blocks_A1_Metric, 330
Private Function Obj_230531(ByVal commandData As Autodesk.Revit.UI.ExternalCommandData,
ByRef message As String, ByVal elements As Autodesk.Revit.DB.ElementSet) As Result
Dim UIApp As UIApplication = commandData.Application
Dim UIDoc As UIDocument = commandData.Application.ActiveUIDocument
If UIDoc Is Nothing Then Return Result.Cancelled Else
Dim IntDoc As Document = UIDoc.Document
Dim WSF As New WorksetKindFilter(WorksetKind.ViewWorkset, True)
Dim FEC As New FilteredWorksetCollector(IntDoc)
Dim WS_Lst As List(Of Workset) = FEC.WherePasses(WSF).ToWorksets
For i = 0 To WS_Lst.Count - 1
Dim WS As Workset = WS_Lst(i)
Dim NM As String = WS.Name
Dim Id As Integer = WS.Id.IntegerValue
Debug.WriteLine($"{NM}, {Id}")
Next
Return Result.Succeeded
End Function