I would recommend using Carbon Copy Cloner (https://sites.fastspring.com/bombich/product/ccc5) to create a bootable external drive with a recovery partition. Then you can replace the internal drive, boot from the external drive, and restore on to the new drive.
It is not free, but it is superior to Time Machine in some ways. (The two are really intended for different purposes.) Even if you can succeed in doing your current task with Time Machine, a more thorough backup solution has advantages for your future, if you have a disk failure.
Although TimeMachine can be used to restore a system, it assumes the existence of a working recovery partition on the hard drive. If the hard drive is corrupted or has died and that is not the case, then it won't work.
After CCC (Carbon Copy Cloner) backs up your drive, it asks if you want to create a Recovery Partition on the destination. This enables you to create an external drive with all the booting and recovery options as your internal drive.
So hypothetically, if you have created such an external drive, you could replace your internal drive with a bare, unpartitioned, unformatted new drive, and restore it to your previous internal drive's state using CCC. (You might need to partition it separately with Disk Utility, I'm not sure.)
In addition, having the CCC external drive would enable you to use your computer as you did before (though more slowly) until you could restore your internal drive back to working condition.