I have to display 404 and 403 error pages if some the weather is true during my component code. I am using /index.php?option=com_live_editor&format=raw to call an element. raiseError just shows me an output from component without any messages.

The reason for using format=raw inside your query string? Is an Ajax call?

JError::raiseError(404, "Message");

may be the appropriate method to show error pages in Joomla.