The timing is probably surprisingly insignificant. The more relevant issue is that the public were asked to vote against something actual and flawed, versus an alternative of projecting their wishes about Britain's future status in the world, access to trade, levels of immigration etc.
c.f. the referendum on voting systems, where the public was asked if they wanted to vote in favour of an actual, flawed replacement system and decided to accept the (in many respects at least as flawed) status quo.
Ironically, I think what would have produced the reverse result in the Brexit referendum would have been a genuinely Eurosceptic government painfully awkwardly negotiating an alternative arrangement outside the EU and asking for the public to ratify it. The other irony being that - on account of the EU needing to be seen to be reasonable in their negotiations - the deal on offer would probably have been better than what we get.
c.f. the referendum on voting systems, where the public was asked if they wanted to vote in favour of an actual, flawed replacement system and decided to accept the (in many respects at least as flawed) status quo.
Ironically, I think what would have produced the reverse result in the Brexit referendum would have been a genuinely Eurosceptic government painfully awkwardly negotiating an alternative arrangement outside the EU and asking for the public to ratify it. The other irony being that - on account of the EU needing to be seen to be reasonable in their negotiations - the deal on offer would probably have been better than what we get.