teD has successfully sussed this one, although OED2 gives an alternate etymology:

Anglo-Irish.

[? for success, or from cess¹ sense 2.]
In phrase bad cess to = ‘bad luck to, evil befall’.
1859 Punch 17 Dec. Carlisle and Russell—bad cess to their clan! 1860 S. Lover Leg. & Stories (ed. 10) 313 Bad cess to you, can't you say what you're bid.


cess¹ sense 2 - Ireland. The obligation to supply the soldiers and the household of the lord deputy with provisions at prices ‘assessed’ or fixed by government; hence loosely used for military exactions generally. Obs. exc. Hist.
1612 Davies Why Ireland, &c. (1787) 20 By their continual cess and extortion


[aside to bill] perhaps our new Ted is more interested in 'gamblen' than gamboling through word history.

I the matter will re-word; which madnesse Would gamboll from. -WS