Obito? While he's the JJ? Yup, any time after that nope. Madara? Unless Izanami is being used as a counter to any Izanagi attempt, then no, it won't work, and since JJ Madara will probably never ever use any kind of Izanagi since he is truly immortal, Itachi can't catch him in Izanami, ever.
But....Itachi will never even land it on Obito or Madara, as they'd rip Itachi apart like a little fodder before he ever moved an inch let alone set up Izanami. So the only one falling here is Itachi.
And Izanami is obviously not an Ocular Genjutsu as you don't set it up using your field of vision.