21 So one of the men who have accompanied us during all the time that the Lord Jesus went in and out among us, 22 beginning from the baptism of John until the day when he was taken up from us—one of these men must become with us a witness to his resurrection.” 23 And they put forward two, Joseph called Barsabbas, who was also called Justus, and Matthias. 24 And they prayed and said, “You, Lord, who know the hearts of all, show which one of these two you have chosen 25 to take the place in this ministry and apostleship from which Judas turned aside to go to his own place.” 26 And they cast lots for them, and the lot fell on Matthias, and he was numbered with the eleven apostles. (Acts 1:21-26 ESV)
Peter, based arguably on his own common sense, arbitrarily narrowed down the options to Joseph and Matthias. Then came the tiebreaker by the casting of lots, favoring the latter. Doesn't this contradict the way apostles are to be called, by the will of God, through the Holy Spirit, according to 1 Corinthians 12?
4 Now there are varieties of gifts, but the same Spirit; 5 and there are varieties of service, but the same Lord; 6 and there are varieties of activities, but it is the same God who empowers them all in everyone. 7 To each is given the manifestation of the Spirit for the common good. 8 For to one is given through the Spirit the utterance of wisdom, and to another the utterance of knowledge according to the same Spirit, 9 to another faith by the same Spirit, to another gifts of healing by the one Spirit, 10 to another the working of miracles, to another prophecy, to another the ability to distinguish between spirits, to another various kinds of tongues, to another the interpretation of tongues. 11 All these are empowered by one and the same Spirit, who apportions to each one individually as he wills. (1 Corinthians 12:4-11 ESV)
27 Now you are the body of Christ and individually members of it. 28 And God has appointed in the church first apostles, second prophets, third teachers, then miracles, then gifts of healing, helping, administrating, and various kinds of tongues. 29 Are all apostles? Are all prophets? Are all teachers? Do all work miracles? 30 Do all possess gifts of healing? Do all speak with tongues? Do all interpret? 31 But earnestly desire the higher gifts. (1 Corinthians 12:27-31 ESV)
How can we reconcile the words of Paul in 1 Corinthians 12, who appears to be telling us that it has to be God himself, through the Holy Spirit, who determines who is going to be an apostle, with the rather strange way in which Matthias was elected as an apostle in Acts 1:21-26?