If there is an extension until just before the EU election agreed with May, but no MEP elections in the UK, revoking Art 50 just before the elections, would keep the UK as member but without UK MEP's representing the UK people in the EU parliament, which would cause that the EU parliament cannot take any decision (with the current EU rules).
A new hard Brexit PM could do this just to cause that laming of the EU parliament.
Just before the elections is not the real issue, because then the UK would be obligated to participate in it. Just after the elections is the real problem, because then the elections are over without UK participation and maybe the whole EU would have to redo it and have to legitimate parliament in the meantime - maybe even a deadlock if the EU parliament would have to approve new elections.
The idea was that Brexit could be delayed until the newly elected MEPs take their seats. The discussion is that this might be a bad idea, because it would give a potential hostile UK PM leverage for extortion. Consequently, the EU might be unwilling to extend any extension beyond the elections without a commitment to hold the elections in the UK as well.
The option to withdraw Article 50 after the elections would hurt the UK as well, because it would be caught inside of a hobbled EU - but a desperate PM might threaten to use it. It would be better to remove that option completely.
If the UK government had put even half as much thought into the Brexit process, we wouldn't be in this situation.