Array index not working in tampermonkey script

I’m working on a little tampermonkey script, to do some clicking automation for a little game.

The way it should work is the following:
In the game, there are cars. You can click on each of these cars and then press “Start Race” to start a race and afterwards, you need to click on a button that says “see results” and then “claim rewards”. The hole script works – but only one time for one car..

Personally I have multiple cars and for each car, you can do 12 races. So what I’d like the script to do, is to go through each car, race it and do that 12 times..

You can see the logic with the timeouts, which work fine (although this might not be practice – they work, as the console.log outputs are there at the right timings).

The only problem I have right now is clicking on the right car. I tried various debuggings, but it just doesn’t want to work. It races with one car only (strange here: the LAST car, not the first) and then it doesn’t do anything anymore, except logging (can’t do anything, if it doesn’t click the car). So it always only does the race with one car, and then doesn’t click any car anymore.. In debugging, you can clearly see, that array is built up correctly though:

enter image description here

Does anybody have an idea what I’m doing wrong? I’ve been sitting here for hours, trying to find the problem…

// ==UserScript==
// @name         AutoPlay Script
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Automatically play
// @author       You
// @match        https://myplayingpage.de
// @icon         https://www.google.com/s2/favicons?domain=https://myplayingpage.de
// @grant        none
// @require      http://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==

(function() {
    'use strict';

    var carsArray = [];
    var carArrayIndex = 0;
    var timeoutTimer = 0; 
    setTimeout(function(){ 
        for(var i = 0; i<12; i++){
            carArrayIndex = 0;
            $('.car-list .item.content').each(function(){  
                carsArray[carArrayIndex] = $(this);
                debugger;
                setTimeout(function(){
                    carsArray[carArrayIndex].click(); 
                    console.log("car click");
                },2000+timeoutTimer);
                setTimeout(function(){ //warte 1 Sekunde
                    $('.custom-btn.btn-green').click(); 
                    console.log("start race");
                },5000+timeoutTimer);
                setTimeout(function(){ //warte 14 Sekunden
                    $('.custom-btn.btn-yellow').click(); 
                    console.log("result click");
                },21000+timeoutTimer);
                setTimeout(function(){ 
                    $('.ant-btn.ant-btn-success, .ant-btn.btn-green').click(); 
                    console.log("rewards claim click");
                },27000+timeoutTimer);
                timeoutTimer+=30000;
                carArrayIndex++;
            });
        }
    },5000);

})();