LogScope in Behavior does not propagate to log statements in Handler

Hello.

I have a problem getting a LogScope to propagate from a Behavior to Handler code so that log statements in the Handler includes the custom log properties from the LogScope. The application is an Azure Function endpoint.

The log statements in the Behavior includes the properties from the LogScope in the log output, but it does not work for log statements in handlers.

Code in Behavior:

public class CommonLoggingBehavior : Behavior<IInvokeHandlerContext>
{
    private readonly ILogger _logger;

    public CommonLoggingBehavior(ILogger logger)
    {
        _logger = logger;
    }

    public override async Task Invoke(IInvokeHandlerContext context, Func<Task> next)
    {
        var scopeData = new Dictionary<string, object>();
        if (context.MessageBeingHandled != null)
        {
            scopeData["NsbMessageType"] = context.MessageBeingHandled.GetType().FullName ?? "UnknownMessageType";
            if (context.MessageBeingHandled is IHasShipmentId nsbMessage)
            {
                scopeData["ShipmentId"] = nsbMessage.ShipmentId;
            }
        }
        using (var logScopeWithData = _logger.BeginScope(scopeData))
        {
            // Includes Scope
            _logger.StartMessageHandler();

            // Includes Scope
            _logger.LogWarning("*** WARNING *** CommonLoggingBehavior invoked for message of type {MessageType}.", context.MessageBeingHandled.GetType().FullName);

            await next().ConfigureAwait(false); // Invokes the actual user handler code
        }
    }
}

Code in handler:

    public async Task Handle(StartBookingCommand message, IMessageHandlerContext context)
    {
        using (var logScope = _logger.BeginScope("ShipmentId inside handler {ShipmentId_inside_handler}", message.ShipmentId))
        {
            _logger.LogDebug("************DEBUG**********StartBookingCommandHandler*");
    }
}

The log statement in the handler does not include the scope from the Behavior.

What am I doing wrong? Or do I have wrong expectations here? Is there a solution?

NServiceBus packages:

    <PackageReference Include="NServiceBus.AzureFunctions.Worker.ServiceBus" Version="6.0.0" />
    <PackageReference Include="NServiceBus.Extensions.Logging" Version="3.0.1" />
    <PackageReference Include="NServiceBus.RavenDB" Version="9.0.0" />