Disable custome error page for spesific path url

Hi, anyone know to disable custom error page for spesific path url?
I want to retun json result with status code 400 & 403 for the spesific path url

All the help means a lot
Thank you.