This is a pun on the phrase 'painted himself into a corner' which means to put oneself in a bad position, but 'coroner' is used in it's place because it sounds similar and because a 'coroner' is an official who investigates violent, sudden, or suspicious deaths, which is who you'd probably come across if you were dying
A dying artist painted himself into a coroner .