get a dose of one's own medicine
To receive the same unpleasant treatment one has given others: “Bart got a dose of his own medicine when everyone in the office started playing practical jokes on him.”
The New Dictionary of Cultural Literacy, Third Edition Copyright © 2005 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company. All rights reserved.