createNotFoundException is not working in symfony

I'm using symfony 3.2. I don't know what happened here when I link the page in to this one

I get this kind of 500 http error enter image description here but when I link this to this one

I get this error page which is correct enter image description here If you notice it, I change only the id of the facility 120 to 119. All want is the same error 404 page. Do I miss something about the setup in symfony? And here is the code of my backend. It just simple action code.

     * @Route("/{transactionId}/facilities/{transactionFacilityId}", name="portal_get_facility")
     * @param Request $request
     * @throws \RangeException
     * @throws QueryException
     * @return Response
    public function getFacilityAction(Request $request) {
            throw $this->createNotFoundException('Invalid facility');