If you're already using setTimeout, why not just use it directly?
function clickLoop() {
document.querySelector('.main-btn').click();
setTimeout(clickLoop, 50)
}