As I said, in that case no one (including FIFA, uefa etc) can compel the player with a contract at a new club to agree to play for current club beyond 30 June. If he agrees then he takes the risk himself.
I agree completely with your post above though that this sets up an unfair situation where for example niasse might agree to a short term contract and therefore play out the season for Everton, but for example willian might not at Chelsea as he doesn't want to risk injury and a lucrative contract elsewhere so they end up an attacker down for last 9 games.
This is part of the reason why carrying on after 30 Jun is not as easy as some seem to think.
you're right - it isn't straight forward for those involved and some teams will benefit from this and others will suffer, but that applies to every decision on how you conclude this season.
Also, for context there are 69 PL players out off contract at the end of this season which is about 20% of the playing staff, of them alot are third choice keepers, retiring players or some injured players as well. Even if the decision was you can't use anyone out of contract, again their would be winners to whom it makes no difference and losers like Chelsea who would lose Willian, Giroud and Pedro, but everyone would be able to field a team.