This happens when the Id that is set in your URL is a valid id (either existing or correctly formatted) but is not an id for any of the records in your page that you are trying to access.
So using something like: http://localhost:8080/p/sample/4503599627370497 will show the message and will redirect to the homepage when the id is not one of the records available.
Using something like: http://localhost:8080/p/sample/4503 will result in a page not found message shown in the browser.