System.NotSupportedException when using DialogService

I'm getting a strange error where as the DialogService is called, I get this error

System.NotSupportedException: 'Serialization and deserialization of 'Microsoft.AspNetCore.Components.RenderFragment1[[Radzen.DialogService, Radzen.Blazor, Version=3.19.10.0, Culture=neutral, PublicKeyToken=null]]' instances are not supported. The unsupported member type is located on type 'Microsoft.AspNetCore.Components.RenderFragment1[Radzen.DialogService]'. Path: $.ChildContent.'

and when I hit continue in Visual Studio's debugging, it just keeps going as if nothing happened, the dialog works as intended after that.

I'm not sure what is causing this, I have triple checked that all the required lines of code mentioned in Getting Started are in correctly and this error doesn't occur in another project.

Unfortunately we haven't seen such error before and we don't know what might cause it.