Well, not quite. The phrase "dismal science" first appeared in Occasional Discourse on the Negro Topic (1849) by Thomas Carlyle. "Not a 'gay science,' I should say, like some we have heard of; no, a dreary, desolate and, indeed, quite abject and distressing one; what we might call, by way of eminence, the dismal science."
Economics was a "dismal science" because it had found the secret of the universe in "supply-and-demand" and this universal law of "supply-and-demand" overrode all other laws of 'human governors'- reducing their duties 'to that of letting men alone.' This is similar to many criticisms of the field today- although it took a slightly different tack.
You see, Thomas Carlyle's tract supported the idea that slavery should be reintroduced to the Caribbean and he damned the nascent field of 'political economy' (as economics was then known) for not agreeing with him. He was absolutely enraged at the idea of a 'black Ireland', where men could not be compelled to work for less than what they determined to be their worth.
That is why economics is called the 'dismal science'. Because, when asked to support the institution of slavery, political economists of the day demurred. They went with what was right, rather than what was expected of them.
I'll take being dismal.