Yes, there is
new NextResponse(componentString, {
status: 503,
headers: { "content-type": "text/html; charset=utf-8" },
});
You can also use a custom error pages to display as mentioned in the resource below.
https://nextjs.org/docs/14/pages/building-your-application/routing/custom-error