I am having the same problem.
I am kind of “solve it” declaring the buffer float[ ] array
float[] audioBuffer = new float[audioSource.clip.samples * audioSource.clip.channels];
Assuming that I have just one channel, the dimension is frequency * seconds, the parameters that you use when you call Microphone.Start(). (For example 44100Hz * 10sec)
If I put a bigger number I get a warning that that number is bigger than 441000. If I put a calculated length (like you) I get your same error.
Now I am trying to work out to see if the program returns good results. But at least I can move on