Using pin12 on the WiFi shield makes it not connect to network

I've spent some time trying to debug, but not going anywhere. Setting the select pin for the barometer to HIGH (which should disable it) doesn't seem to do much.

The error code I get is that the wifi shield is not present. I'm now just playing with a simple code to see if I can get it to connect to my wifi. This is my code, same wiring as before.

#include <WiFi.h>

char ssid[] = "a?";     //  your network SSID (name) 
char pass[] = "b";  // your network password
int status = WL_IDLE_STATUS;     // the Wifi radio's status

void setup() {
  Serial.begin(9600);
  
  // check for the presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present"); 
    // don't continue:
    while(true);
  } 
  
 // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) { 
    Serial.print("Attempting to connect to WPA SSID: "); 
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }
   
  // you're connected now, so print out the data:
  Serial.print("You're connected to the network");
}

void loop() {
  delay(10000);
}

Which outputs "WiFi shield not present".

Inserting the following at the beginning of the setup() method does nothing:

  pinMode(9, OUTPUT); // Connected to the select pin of the barometer
  digitalWrite(9, HIGH);

By unplugging pin 12 from my barometer (barometer SDO), everything works fine (except I don't get a barometer reading that is).

I'm struggling here. Am I missing something?