We have to approach this very carefully ..
Until the day of Pentecost, until the birthday of the church, the Holy Spirit did not indwell men. The Holy Spirit all throughout the OT (with one exception) was ON THEM not IN THEM
So the Spirit was on them as He willed for His purpose
When Jesus breathed the Holy Spirit on to the Apostles it was ON THEM not IN THEM
Remember Jesus saying He had to go away so that the Holy Spirit could come?
The apostles did not have the indwelling Holy Spirit when they chose the replacement.. that indwelling Spirit was poured out on not only the apostles but all the disciples on Pentecost.. it is Christ's gift to the church
As the redeemed we have the Holy Spirit in us, that does not mean every decision we make is correct..
Matthias was chosen by men, and did the work of an apostle in bringing the message.. He was a faithful messenger.. But Christ had already selected His replacement for Judas.. Paul
I stand corrected...I agree prior to Pentecost, the Spirit fell upon folks, not indwelling them...