I followed the link Automatically "Allow Access" for IMPORTRANGEs in Google Sheets? StackExchange added to the discussion, and learned something new:
You actually DON'T HAVE TO specify the Tab name in IMPORTRANGE! This formula actually works:
It imports cell A1 from the leftmost visible Tab in the document at [URL]...
From the question
Can a Script distinguish IMPORTRANGE N/As due to non-existent Tabs from N/As due to not having access permissions?
, but I wonder, might there be some way a Script could distinguish between the two, and return a specific result once the docs are connected?
No, but you could use a script to check if the sheet exists.
var spreadsheet = ...
Judging from your formula, February or January must be tab names belonging to the spreadsheet.
If that is the case, use the following syntax
=query(importrange("1L86iP0GLHTubwfvxs1kJ4ocbmgRAd4Iz0000000M", C1&"!A2:F"),"Select Col6, Col5 where Col1 is not null",0)
where cell C1 has a value of February or January or...