IIRC, irani, like aryani is a word that goes back to ancient Indo-European before the Persian/Sanskrit split. Iran as a name for the people goes way back, although pars,persia,farsi,etc. are also seen.
Ah. But, so I’ve read, the name change was at least in part to appease Nazi Germany.