Here’s an example. https://imgur.com/a/4jyM6t5
First image: The paragraph style for the “Note” box has only autoleading and 13 pt before and 13 pt after applied.
The body style has 0 pt before, 6.5 pt after. The heading with yellow rule has 6.5 pt before, 10 pt after. So it seems that the space between the note box and the yellow rule heading should be larger than the space between the note box and the following body paragraph, but it’s actually smaller for some reason. To Dieter’s question, I’m [shamefully] not using baseline grids, so that shouldn’t be the issue.
Third image: If I decrease the space before and after the note box to 6.5 pt, the distance between the yellow rule heading increases instead of decreasing.
Second image: I can increase the size of the space after to 80 pt, and it’s way too small. It’s really weird—I adjust it, and the spacing jumps in increments of the leading of the paragraph below. The spacing above the yellow rule heading is the same when the space after the note box is set to 11, 27, 43, 59, etc. (its leading is 16 pt), up until about 90 pt. The spacing above the body is the same in increments of 13 (its leading).
The paragraph shading is a good suggestion, but I sometimes have content with mixed paragraph styles in these boxes, so I’d prefer to do it with the anchor if possible.