huancp, I see you are based in San Francisco, so for the sake of this response I will assume your stair is in a California jurisdiction. Handrails need to comply with both CBC chapter 10 for Means of Egress
and (assuming this is not a private dwelling) CBC 11B for accessibility.
View attachment 7990
CBC 11B-505.5 says:
Handrails may be located in a recess if the recess is 3" maximum deep...
What your detail shows is hand rails essentially
recessed 3" as measured from the edge of the walking surface / face of side wall of the stairs to centerline of the handrail, which means the outer edge of the smallest (1.25") allowable handrail would be recessed at least 3 5/8", which is too far away to meet CBC 11B-505.5.
One might even interpret "recess maximum 3" deep" to mean the back wall of the recess would be 3" deep, which really means the side of the handrail must be immediately adjacent to the walking surface to comply with CBC 11B.
View attachment 7988
The detail that can fix this problem requires the post-to-handrail supports to offset the handrail so it is immediately adjacent (or slightly encroaching) to the path-of-travel, something like this:
View attachment 7989