Access to additional light shadow data in custom shader

I want to change the visual of the additional lighting and shadow. I had no problem getting the light data, but the shadow value is always = 1 (although I see the additional shadow on the standard lit shader). I tried different methods .
Unity 6 URP Forward+

Shader "Custom/AdditionalLights"
{
    Properties
    {
        _LitColor("Lit Color", Color) = (0, 1, 0, 0.5) // Green
        _ShadowColor("Shadow Color", Color) = (1, 0, 0, 0.5) // Red
    }
    
    SubShader
    {
        Tags 
        { 
            "RenderType" = "Opaque"
            "Queue" = "Overlay"
            "RenderPipeline" = "UniversalPipeline"
        }
        
        Cull Off
        ZWrite On
        Pass
        {
            Blend SrcAlpha OneMinusSrcAlpha
            
            HLSLPROGRAM
                        
            #pragma vertex vert
            #pragma fragment frag
            
            #pragma multi_compile _ _FORWARD_PLUS
            #pragma multi_compile_fragment _ _ADDITIONAL_LIGHTS
            #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
            
            #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
            #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
            #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
            
            struct Attributes
            {
                float4 positionOS   : POSITION;
                float3 normalOS     : NORMAL;
            };
            
            struct Varyings
            {
                float4 positionCS  : SV_POSITION;
                float3 positionWS  : TEXCOORD1;
                float3 normalWS    : TEXCOORD2;
            };
            
            Varyings vert(Attributes IN)
            {
                Varyings OUT;
                OUT.positionWS = TransformObjectToWorld(IN.positionOS.xyz);
                OUT.positionCS = TransformWorldToHClip(OUT.positionWS);
                OUT.normalWS = TransformObjectToWorldNormal(IN.normalOS);
                return OUT;
            }
            
            half4 _LitColor;
            half4 _ShadowColor;

            half GetAdditionalShadow(int lightIndex, float3 positionWS, half3 lightDirection)
            {
                return AdditionalLightRealtimeShadow(lightIndex, positionWS, lightDirection);

                // half4 shadowParams = GetAdditionalLightShadowParams(lightIndex);
                // ShadowSamplingData shadowSamplingData = GetAdditionalLightShadowSamplingData(lightIndex);
                // return AdditionalLightRealtimeShadow(lightIndex, positionWS, lightDirection, shadowParams, shadowSamplingData);

                //return GetAdditionalLightShadowFade(positionWS);
                
                // float4x4 lightMatrix = _AdditionalLightsWorldToShadow[lightIndex];
                // float4 shadowCoord = mul(lightMatrix, float4(positionWS, 1.0));
                // return SAMPLE_TEXTURE2D_SHADOW(_AdditionalLightsShadowmapTexture, sampler_LinearClampCompare, shadowCoord.xyz);
            }
            
            half4 frag(Varyings input) : SV_Target0
            {
                // The Forward+ light loop (LIGHT_LOOP_BEGIN) requires the InputData struct to be in its scope.
                InputData inputData = (InputData)0;
                inputData.positionWS = input.positionWS;
                inputData.normalWS = input.normalWS;
                inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS);
                inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);

                half4 color = 0;
                // Additional light loop. The GetAdditionalLightsCount method always returns 0 in Forward+.
                uint pixelLightCount = GetAdditionalLightsCount();
                LIGHT_LOOP_BEGIN(pixelLightCount)
                    Light light = GetAdditionalLight(lightIndex, inputData.positionWS);

                    if (light.distanceAttenuation > 0)
                    {
                        float NdotL = dot(inputData.normalWS, normalize(light.direction));

                        if (NdotL > 0)
                        {
                            half shadow = GetAdditionalShadow(lightIndex, inputData.positionWS, light.direction);
                            
                            if (shadow == 0)
                            {
                                return _LitColor;
                            }
                        }
                        
                        color = _ShadowColor;
                    }
                LIGHT_LOOP_END
                return color;
            }
            
            ENDHLSL
        }
    }
}

What am I doing wrong?

I believe there is a bug in Unity 6. You can use the manual method or wait for the fix

Found the problem. For some reason, the shadow map was empty due to the queue.

This is fixed version:

Shader "Custom/AdditionalLights"
{
    Properties
    {
        _LitColor("Lit Color", Color) = (0, 1, 0, 0.5) // Green
        _ShadowColor("Shadow Color", Color) = (1, 0, 0, 0.5) // Red
    }
    
    SubShader
    {
        Tags 
        {
            "RenderPipeline" = "UniversalPipeline"
            "Queue" = "Geometry"
        }
        
        Cull Off
        ZWrite On
        Pass
        {
            Blend SrcAlpha OneMinusSrcAlpha
            
            HLSLPROGRAM
                        
            #pragma vertex vert
            #pragma fragment frag
            
            #pragma multi_compile _ _FORWARD_PLUS
            #pragma multi_compile_fragment _ _ADDITIONAL_LIGHTS
            #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
            
            #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
            
            struct Attributes
            {
                float4 positionOS   : POSITION;
                float3 normalOS     : NORMAL;
            };
            
            struct Varyings
            {
                float4 positionCS  : SV_POSITION;
                float3 positionWS  : TEXCOORD1;
                float3 normalWS    : TEXCOORD2;
            };
            
            Varyings vert(Attributes IN)
            {
                Varyings OUT;
                OUT.positionWS = TransformObjectToWorld(IN.positionOS.xyz);
                OUT.positionCS = TransformWorldToHClip(OUT.positionWS);
                OUT.normalWS = TransformObjectToWorldNormal(IN.normalOS);
                return OUT;
            }
            
            half4 _LitColor;
            half4 _ShadowColor;
            
            half4 frag(Varyings input) : SV_Target0
            {
                // The Forward+ light loop (LIGHT_LOOP_BEGIN) requires the InputData struct to be in its scope.
                InputData inputData = (InputData)0;
                inputData.positionWS = input.positionWS;
                inputData.normalWS = input.normalWS;
                inputData.viewDirectionWS = GetWorldSpaceNormalizeViewDir(input.positionWS);
                inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);

                float finalShadowAttenuation = 0;
                bool inRange = false;
                // Additional light loop. The GetAdditionalLightsCount method always returns 0 in Forward+.
                uint pixelLightCount = GetAdditionalLightsCount();
                LIGHT_LOOP_BEGIN(pixelLightCount)
                    Light light = GetAdditionalLight(lightIndex, inputData.positionWS, half4(1,1,1,1));

                    if (light.distanceAttenuation > 0)
                    {
                        inRange = true;
                        float NdotL = dot(inputData.normalWS, normalize(light.direction));
                        float shadowAttenuation = NdotL > 0 ? light.shadowAttenuation : 0;
                        finalShadowAttenuation = max(finalShadowAttenuation, shadowAttenuation);
                    }
                LIGHT_LOOP_END
                return inRange ? lerp(_ShadowColor, _LitColor, finalShadowAttenuation) : half4(0,0,0,0);
            }
            
            ENDHLSL
        }
    }
}