How do nodes reach consensus on when the target is recalculated? Due to network latencies, some nodes may think they are at a different block height than the rest of the network. How then does a node decide if the target has been recalculated since that changes every 2016 blocks.
The target recalculation is not something that is broadcast or something that is announced to nodes. Rather nodes calculate the targets for each block according to a specific algorithm that only requires the blockchain data. It is based on the previous block's target, the block height, and the block timestamps. So each block's target is done completely independently from the network with the only information required being the the blockchain.

Since the algorithm for calculating the target is deterministic, each node will calculate the same difficulty for the same block heights given the same blockchain data.