Fan control using buck converter
The current from your 7.5V buck converter flows through your fan and needs to go back to the buck converter to build a closed current loop - you cannot connect just a random ground.
This means, as stated in the comments, if the buck (or the buck/boost) converter is isolated and doesn't share the same ground as your ESP32, the current loop is not closed.
You can verify this with a multimeter and measure the resistance between the two grounds, should be close to 0Ohms.