If you're getting nav.to(NaN) with Go To Page links, it typically means that the link points to a page outside of the range that is exported. This has been the case for years.
For example, if you export pages 1-10 and page 2 has a TOC linked to page 11 of the document, the link will show NaN in the code (because page 11 wasn't found in the output pages).
In the case of your document, the buttons in sec2 are pointing to pages in sec1, which are not in the export, so this is the expected behavior.
Even though the page names in your sec2 Alternate Layout are "1,2,3,4,5" the Buttons and Form panel uses the page's document offset (1-8 in this case), so page 1 of sec2 is 4. If you link to anything < 4, it will result in NaN when your export range starts with 4.
I'm not aware of any changes to in5 between 3.6.4 and 3.6.9. This has always been the intended behavior.
The only exception is when you export Responsive Layouts, which have matching page counts in each layout. In that case, a Go To Page 3 action, would go to the 3rd page in the currently visible layout (regardless of its absolute document offset position).