SetEntityNoCollisionEntity does not work when inside a loop

Hello, here is some information to ease on bug reproduction.

(Client Script Bug)
FXServer version: 7080 Windows
What I expected to happen: When using SetEntityNoCollisionEntity on a created object inside a for loop, it would work as expected.
What actually happens: Using SetEntityNoCollisionEntity on a created object that’s inside a for loop, makes it not work.

RegisterCommand("fred", function()
  local playerPed = PlayerPedId()
  local playerVehicle = GetVehiclePedIsIn(playerPed, false)

  RequestModel(GetHashKey('prop_offroad_tyres02'))
  while not HasModelLoaded(GetHashKey('prop_offroad_tyres02')) do
      Wait(0)
  end

  for i = 1, 20, 3 do
    local object = CreateObject(GetHashKey('prop_offroad_tyres02'), GetEntityCoords(playerPed) + vector3(-1 * i, -1 * i, -1), false, true, false)
    SetEntityNoCollisionEntity(playerVehicle, object, false)
  end
end)

Update: Doing it in a while loop works as expected