I do not think this is the correct way to handle this. The OnGet() method should return NotFound(). And then you should add a global 404 not-found handler. The way you're doing it, you have to add a NotFound page for each case and you still won't catch not found errors that occur when the user mistypes the URL.
Hello Sir, what a pleasant surprise, very good lesson that developers tend to miss. My VS 2019 Community version is 16.4.2 and when I went to add the NoFound Razor Page using the (same as you did) Add Razor Page it did not created the proper namespace, like the one in your video, it created just namespace RazorPagesTutorial, I created another razor page in the Employees folder and it did the same. If possible what version are you using? I believe that an update broke the scaffolding engine somehow? Oh, when I do the Add --> New Item --> and select Razor Page, it works fine? Thanks Ray