Sorry but 2017 was fought on brexit...so how you try and use that excuse is beyond me. Labour had Corbyn as a leader both times. So you cannot blame that.
In 2017 Labour accepted the referendum result; in 2019 it faffed about. Largely on account of the actions of the current 'leadership' candidates and their metropolitan mates.