Sussex on wrong end of result in thrilling Middlesex clash