SQL Server – Nested Stored Procedures and Catch Blocks – Problem ERROR_PROCEDURE ()

I have noticed something odd and hope that a member of the community has an answer for me. I noticed that when a stored procedure is nested seems all blocks before the last catch block have a strange bug with the function ERROR_PROCEDURE () where it returns the name of the previous block procedure. NOTE: This only occurs when using RAISERROR. When using THROW, the latest procedure in the chain is always reported.

Since it was probably confusing, here is an example.

SET NOCOUNT ON

IF OBJECT_ID (# tempdb .. # spCatchTest1 #) IS NOT NULL START
DROP PROCEDURE # spCatchTest1
END
GO

CREATE PROCEDURE # spCatchTest1
AS
TO START
START TRY
EXEC # spCatchTest2
END TRY
START TO TAKE
PRINT # CATCH WHERE = # spCatchTest1; ACTUAL = + # ERROR_PROCEDURE ()
DECLARE @Err NVARCHAR (4000) = ERROR_MESSAGE ()
RAISERROR (@Err, 16, 10);
-; DISCARD
END OF CAPTURE;
END
GO

IF OBJECT_ID (# tempdb .. # spCatchTest2 #) IS NOT NULL START
DROP PROCEDURE # spCatchTest2
END
GO

CREATE PROCEDURE # spCatchTest2
AS
TO START
START TRY
EXEC # spCatchTest3
END TRY
START TO TAKE
PRINT # CATCH WHERE = # spCatchTest2; ACTUAL = + # ERROR_PROCEDURE ()
DECLARE @Err NVARCHAR (4000) = ERROR_MESSAGE ()
RAISERROR (@Err, 16, 10);
-; DISCARD
END OF CAPTURE;
END
GO

IF OBJECT_ID (tempdb .. # spCatchTest3) NOT NULL BEGIN
DROP PROCEDURE # spCatchTest3
END
GO

CREATE PROCEDURE # spCatchTest3
AS
TO START
START TRY
EXEC # spCatchTest4
END TRY
START TO TAKE
PRINT # CATCH WHERE = # spCatchTest3; ACTUAL = + # ERROR_PROCEDURE ()
DECLARE @Err NVARCHAR (4000) = ERROR_MESSAGE ()
RAISERROR (@Err, 16, 10);
-; DISCARD
END OF CAPTURE;
END
GO

IF OBJECT_ID (# tempdb .. # spCatchTest4 #) IS NOT NULL START
DROP PROCEDURE # spCatchTest4
END
GO

CREATE PROCEDURE # spCatchTest4
AS
TO START
START TRY
SELECT 1/0
END TRY
START TO TAKE
PRINT # CATCH WHERE = # spCatchTest4; ACTUAL = + # ERROR_PROCEDURE ()
DECLARE @Err NVARCHAR (4000) = ERROR_MESSAGE ()
RAISERROR (@Err, 16, 10);
-; DISCARD
END OF CAPTURE;
END
GO

EXEC # spCatchTest1 

This will produce:

EXPECTED CATCH = # spCatchTest4; ACTUAL = # spCatchTest4
EXPECTED CATCH = # spCatchTest3; ACTUAL = # spCatchTest4
CATCH WHERE = # spCatchTest2; ACTUAL = # spCatchTest3
EXPECTED CATCH = # spCatchTest1; ACTUAL = # spCatchTest2
Msg 50000, Level 16, State 10, Procedure # spCatchTest1, Line 11 [Batch Start Line 81]
Divide by zero error encountered.

As you can see on the second line, the top-level capture incorrectly specified the name of the procedure. It seems only assign the procs that occur in the string after the error.

Has anyone noticed this? Plus, it's a bug, correct? Is there anyway to get the correct procedure name once nested?