@kiwicreative I added the code to the block, but this is where I think something more fundamental is going on.
The $posts variable seems to be empty. I have a block that adds custom fields to the page they’re assigned to. That works fine.
What I want to do is pull the same fields into the related page in a block. The
if( $posts ) conditional appears to evaluate as false and renders nothing in the block.