Displaying Content Only in Certain Page IDs Not Working

I am really quite unsure what is causing this unexpected behavior as you said it worked and then suddently it started with this issue. You will need to turn on debugging, disable plugins and check for any custom filters etc which might be causing this.

Also, consider the possibility that WordPress core got corrupted by something. If you suspect something like this, make a back up of your side and reinstall WordPress.

Most probably, the best solution to your problem to make this more reliable is to make use of a custom page template for these pages that needs to show the specific form. This will save you from hardcoding or changing your theme from time to time to update specific ID’s.

It is as easy as selecting this custom page template from the page selection meta box when you create a page that need this specific form to display