Replication SQL Server 2016
Transactional Replication is not intended as a High Availability/Disaster Recovery solution.  There is no client connectivity support for failover, and it's operationally complex.

You should usually use AlwaysOn Availability Groups instead.


  how should the subscriber server be configured so that when a failover of the publishing node occurs, the data written in the subscriber is replicated later to the publisher.


Either remove replication and re-create it with the subscriber as the new publisher, or use Bi-Directional Transactional Replication, or Peer-to-Peer Transactional Replication.