ERC is a warning for you to check your schematic.
Quite sensibly KiCad detects that your relay pin 4 is bought up one level of the hierarchy and then left open.
9 times out of ten, this would be a mistake.
It is up to you, the designer, to decide that the warning is a false alarm and can safely ignore it. ERC won’t disturb the PCB layout.
If I remove the “no connection” flags then I get a different ERC error that says that I have unconnected pins. It looks like the two warning types don’t agree whether the pins are connected or not.
I can just ignore the errors, but I think this may be a bug?
The No Connect crosses are only supposed to be used directly on pins of symbols, and not on hierarchical sheet connectors. I have not seen them used in this way before.
I am wondering whether this may be worth a feature request. I hope / think KiCad is going into the direction of diminishing the distinction between schematic symbols and hierarchical sheets. In a comment on Gitlab (I think it was the topic about design blocks) I once wrote a comment about being able to add a schematic sheet to a schematic symbol. That way a prototype could be made with “breakout boards”, and a later more integrated PCB could be made by replacing the breakout boards with the actual circuitry on those boards. I think there is also some work being done on being able to modify schematic symbols directly in the schematic editor. This is also a step towards merging the functionality of a symbol and a hierarchical sheet connector.
In my mind there was a boundary at the hierarchical pin, so I expected the “no connect” marker to say that the hierarchical pin was unconnected. In reality, KiCAD treats it as one big netlist and then the warning makes sense.
In addition, there is a warning for unconnected hierarchical pins - regardless if they are connected on the inside of the subsheet.
In my case I will just ignore the warning. I am using this same subsheet in multiple places and sometimes I need all pins and sometimes I want to leave some unconnected.