Picking random value out of array - could caching be a factor for not working well?

I work with Cake 3.9. I have a simple array of numbers and I want to pick a random value from it.
Often the selected number is selected again with the next request, often a few requests later.
Could caching be a factor?
I use php “rand” as a random generator. I also tried “random_int”. It’s the same for both.

The array has up to 1200 items and looks like this:
$reduziert[’1234’, ’2345’, ’0134’, …]

My code looks like this:
$anzahlReduziert = count($reduziert);
if ($anzahlReduziert == 0) {
$this->Flash->success(__(‘Keine Pflanze mehr gefunden. Ausschliessungen aufheben oder andere Pflanzen wählen.’, [‘clear’ => true]));
return $this->redirect([‘controller’ => ‘Options’, ‘action’ => ‘lernOptionen’]);
}

// aus reduzierter Pflanzenzahl eine zufällige auswählen
//$random = rand(0, $anzahlReduziert-1);
$random = random_int(0, $anzahlReduziert-1);
$gewählteArt = $reduziert[$random];

$pl = TableRegistry::get(‘Plants’);
$query = $pl->find();
$plant = $this->Plants->getPflanzeAnhandAuswahlnr ($gewählteArt, $optionen[‘bilder’], $query);

Does anyone have any idea what I could do?

Thanks for a helpful answer.