Include UDFs in replication publication on SQL Server 2012
This issue was posted on Connect:


  We can't snapshot any User Defined functions to SQL 2016 version from
  existing SQL 2014 servers. They work fine within 2016 versions and
  from SQL 2016 to SQL 2014\2012.


MS's answer is:


  This issue is fixed in the following cumulative update for SQL Server:
  
  Cumulative Update 4 for SQL Server 2016.
  
  It contains one fix: FIX: Snapshot Agent fails when you publish UDF’s
  to SQL Server 2016 Distributor in Transactional Replication
  https://support.microsoft.com/en-us/help/3197883/fix-snapshot-agent-fails-when-you-publish-udf-s-to-sql-server-2016-distributor-in-transactional-replication