wixLocation.to function resetting dropdown's

Your CODE is very unclear and chaotic. I tried to reconfigure your code and reformating it a little bit, for better reading.

$w.onReady(()=>{
    uniqueDropDown1(); //<--- automatic population of DD1 when page is ready!
    $w('#dynamicDataset').onReady(()=>{
       console.log("The dataset is ready to be filtered.");
       let number = $w('#numberDropDown').value;
       $w('#dynamicDataset').setFilter(wixData.filter().eq("number", number))
       .then(()=>{
          console.log("Dataset1 filtered with the matching title from dropdown");
          let getItem = $w('#dynamicDataset').getCurrentItem();
          let activeDynamicItem = $w('#dynamicDataset').getCurrentItem();
          let fieldX = activeDynamicItem['photoCredit']; console.log(fieldX); 
          console.log(activeDynamicItem);
          if (fieldX && fieldX === "") {$w('#text488').collapse();} 
          else {$w('#text488').expand();}
      }).catch((err)=>{console.log(err);});
 
      //---------- Class-Dropdown------------------------
        $w('#classDropDown').onChange(()=>{
            uniqueDropDown2(); //<-------- populating DropDown2
            $w('#numberDropDown').enable(); 
            $w('#numberDropDown').value = null;
            $w('#box9, #box10, #text356, #text472').collapse();
            $w('#button15, #image14, #box8, #repeater1').collapse(); 
       });

     //---------- Number-Dropdown------------------------
        $w('#numberDropDown').onChange(()=>{
           let page = event.target.value;
           let path = page;
           wixLocation.to(`/locomotive-logs-1/${path}`);
        });
    });
});


// ---------------------- FUNCTIONS ------------------------
function uniqueDropDown1(){
   wixData.query("LocoLogs")
   .ascending('class')
   .limit(1000)
   .find()
   .then(results =>{
       const uniqueTitles = getUniqueTitles(results.items);
       $w('#classDropDown').options = buildOptions(uniqueTitles);
   });
   function getUniqueTitles(items) {
      const titlesOnly = items.map(item => item.class);
      return [...new Set(titlesOnly)]; 
   } 
   function buildOptions(uniqueList){
      return uniqueList.map(curr => {return {label:curr, value:curr};});
   }
}

function uniqueDropDown2(){
   wixData.query('LocoLogs')
  .contains("class", $w('#classDropDown').value)
  .ascending('number')
  .limit(1000).find()
  .then(results =>{
     const uniqueTitles = getUniqueTitles(results.items);
     $w('#numberDropDown').options = buildOptions(uniqueTitles);
   });
   function getUniqueTitles(items){
      const titlesOnly = items.map(item => item.number);
      return [...new Set(titlesOnly)];
   }
   function buildOptions(uniqueList){
      return uniqueList.map(curr =>{return {label:curr, value:curr};});
   }
}

export function numberDropDown_change_1(){
    $w('#box9, #box10, #text356, #text472, #button15').expand();
    $w('#image14, #box8, #repeater1').expand();
}

export function button15_click(){
    $w('#text484, #text482, #text485, #text483').expand();
    $w('#image15', #button14).show();
    $w('#image14, #text488').collapse();
    $w('#button15').hide();
}

export function button14_click_1(){
    $w('#text484, #text483, #text485, #text482').collapse();
    $w('#image15, #button14').hide();
    $w('#image14, #text488').expand();
    $w('#button15').show();
}

Perhaps now you will be able to find your bug. Investigate your CODE step by step and put console-logs onto important code-lines, to understand your own code better.