How to display another message instead of 403 when trying to open a display of an unpublished product? When somebody tries to open the product display page for the product which is unpublished, it results in the access denied 403 page being shown.

I want to display a message ("This product is not available as of now, check other products.") instead of showing 403 page.
You could add a view as the error page.

Add the view with page (with appropriate path) and attachment as your error page. Filter it on your Product display, pass in the nid as contextual filter and be as creative as you want. The attachment can show the details for the Product that is no longer available, the actual page view can show similar products as alternatives etc. The not found for the contextual filter can be the generic 403 for anything other than products.

Then add the path of the view to the 403 error page setting at admin/config/system/site-information