The validation logic in interfaces wireguard wgX address x.x.x.x is broken for /31 networks where it doesn't accept the "broadcast address", which is valid in this case.
# set interfaces wireguard wg0 address 172.16.0.4/31 Invalid value Value validation failed Set failed