作法自毙

get caught in one's own trap

zuò fǎ zì bì ㄗㄨㄛˋ ㄈㄚˇ ㄗㄧˋ ㄅㄧˋ