I can observe the same behavior in KiCad 6.0.4. The rule seems fine and works for THT Testpoints on both outer layers and SMD Testpoints on the TOP layer. The BOTTOM layer clearance for SMD Testpoints is not adjusted.
There may be a different condition for the backside courtyard. See the syntax help. This may have changed a bit for the upcoming v7. I haven’t tested it. It may depend on the non-flipped/flipped status of the footprint.
EDIT: insideCourtyard vs insideBackCourtyard. IIRC recognizing this problem/bug resulted to some changes, and in v7 there’s a condition named “intersectsCourtyard” which should check for both front and back. (“insideCourtyard” is deprecated.)
Expression functions
All function parameters support simple wildcards (* and ?).
A.intersectsCourtyard(’<footprint_refdes>’)
True if any part of A lies within the given footprint’s principal courtyard.
A.intersectsFrontCourtyard(’<footprint_refdes>’)
True if any part of A lies within the given footprint’s front courtyard.
A.intersectsBackCourtyard(’<footprint_refdes>’)
True if any part of A lies within the given footprint’s back courtyard.
Yes it is true that the active layer needs to be changed in order to see the clearance ring. But the ring itself is not consistent with the design rules. Mine is 6.0.11 So I guess I would have to wait for 7 to be a stable release.