According to Wikipedia:
The octave number is tied to the alphabetic character used to describe the pitch, thus:
In describing musical pitches, nominally enharmonic spellings can give rise to anomalies where, for example in meantone temperaments C♭
4 is a lower frequency than B3; but such paradoxes usually do not arise in a scientific context.
This reddit thread is also worth looking through: https://www.reddit.com/r/musictheory/comments/67uqni/is_cflat_4_the_note_one_semitone_below_middle_c/dgthm9l/