This happens if you are using the same dbcontext object into another functions and doing savechanges.
If you want to limit the dbcontext scope inside the function then do by using as shown below.
Example
public async Task<Result<ReturnResult>> Handle(CreateDocumentTypeCommand request, CancellationToken cancellationToken)
{
var documentType = DocumentType.Create(request.Id,request.documentName,request.documentNamebn,request.documentSerial,request.categoryId,request.description);
using (var newContext = new YourContext())
{
await newContext.DocumentType.AddAsync(documentType, cancellationToken);
await newContext.SaveChangesAsync(cancellationToken);
}
return Result.Ok(ReturnResult.Created());
}