Finally, after several days and countless tests, I discovered that the issue was related to the project itself. As stated in the Laravel factories documentation, the line 'customer_id' => Customer::factory() should never create a customer if the intent is to select an already existing one. Despite changing the logic to 'customer_id' => fake()->randomElement(Customer::all('id')) as @williamrb suggested, the same issue persisted. However, instead of occurring on record 11, it now happened randomly on 6, 12, 4, etc. Somehow, and I eventually gave up trying to figure out why, the framework did not behave as expected.
Perhaps it was due to having created and deleted multiple migrations, seeders, factories, and models incorrectly within the same project, causing it to break. After all, none of us fully understand what Laravel does behind the scenes with migrations, factories, seeders, etc. In the end, I managed to make it work by modifying the migration for the vehicles table's foreign key from:
$table->foreignId('customer_id')->constrained('customers')->onDelete('cascade');
to:
$table->unsignedBigInteger('customer_id');
$table->foreign('customer_id')->references('customer_id')->on('customers')->onDelete('cascade');
This resolved the issue. However, days later, I noticed that using the relationships still did not work as expected. As a result, I decided to create a completely new project from scratch, using exactly the same code I posted in my question, and it worked. The issue was indeed with the project itself.
I hope someone can explain why this might have happened so I can identify these types of problems more quickly in the future.