There are two ways to do an error page with Apache/.htaccess:
You can redirect to an error page, which means the first response will be a 301 redirect to the error page, and the status code of the final URL is whatever the page on that URL returns. If you want to return a 404 status code to be returned, you can do that with PHP.
You can provide a file to use as the error page. If you have this, the server shows the contents of the error page file with a 404 status code. You’re not redirected, which means the URL doesn’t change.
Without your real URL, there is really no way to tell what is going on. Your redirect looks like it might work, but only if you are also stripping the HTML and PHP tags. The article linked below shows some examples for htaccess error pages if you are interested. If you would like further assistance, please provide your URL.
Also, note that WordPress takes care of 404 pages automatically, so if you are using WordPress, that is why.