Market ends lower; midcaps tumble over 2%, PSU banks, industrials drag