Dynamic Page shows non-existent key values

A button on the login page (page1) is supposed to take the user to a dynamic maintenance page (page2) for their account (using their logged-in ID as the dynamic key value into the data set.) Instead, the link from page1 results in a 404-not found because of an incorrect key value being passed. When previewing the maintenance page (page2) using the preview button in edit mode, it shows 2 non-existent key IDs instead of the 5 real IDs that are in the linked data set. We cannot figure out where these 2 non-existent IDs are coming from nor how to get rid of them. When inspecting the button on page1 which is supposed to call the maintenance page, we can see that it already has one of the 2 incorrect IDs attached to the anchor tag which means that it is not being built correctly. So, we seem to have two issues: 1) the maintenance page (page2) won’t preview correctly with the existing data and 2) the incorrect key values that page2 has ‘locked in’ are being incorrectly used in the original login page (page1) to create a non-functioning anchor tag.