From your second link:
The Massachusetts law, passed in September to authorize Kirks appointment, provides that an appointed Senator shall serve until the election and qualification of the person duly elected to fill the vacancy.
Note that it says election and qualification, making it appear Kirk stays until Mass is done with their process.
Qualification is different from certification. Election results are certified. Candidates are qualified. The legal interpretation I get from that is based on a scenario like Joe Bidens. Biden was elected November 7th 1972. He turned 30 years old on November 20th. He was elected to, but not qualified for, the senate on November 7th. In Biden's case, it did not matter, because he would not be sworn in until January 3rd 1973, when all of the new senators were sworn in.
I would be curious how the Massachusetts law read when Teddy was sworn in less than 24 hours after the polls closed.
The Massachusetts law, passed in September to authorize Kirks appointment, provides that an appointed Senator shall serve until the election and qualification of the person duly elected to fill the vacancy. This would seem to support the position that Kirk can continue to serve after the special election is held. However, the Senate has previously found that substantially similar state laws cannot extend the term of an appointed Senator beyond the date of the special election.
On May 7, 1937, George Berry was given a temporary appointment as U.S. Senator from Tennessee to fill a vacancy created by the death of Senator Nathan Bachman. On November 8, 1938, a special election was held to fill the seat. In accordance with Tennessees normal practice, it took several weeks before the votes were counted and a winner was not certified until January 3, 1939. The applicable Tennessee law provided that a temporary Senator shall hold office until his successor is elected at the next biennial election and qualifies. Based on this law, Berry claimed that he was entitled to hold office and be paid until his successor was certified and/or actually seated by the Senate.
Berrys claim was referred to a subcommittee of the Senate Judiciary Committee, which held a hearing and considered legal arguments on the matter. A legal analysis prepared for the subcommittee found that in view of [Seventeenth Amendments] purpose of providing for representation in the Senate by persons elected by popular vote both for full terms and for unexpired terms it seems reasonable to assume that no temporary appointment was to be authorized except for the intervening period between the creation of a vacancy and the day when the people by their votes actually elect a successor, or, in other words, until they elect a person to fill the vacancy.
In addition to the text and purpose of the Seventeenth Amendment, the analysis relied on various Senate precedents, including an October 15, 1918 ruling by Vice President Marshall, who found that the phraseology of the amendment was radically different than that of various state laws that permitted appointees to serve until their successors were elected and qualified. Marshall concluded that regardless of the fact that Senators-elect must run the gamit of executive, administrative, judicial and senatorial investigation before they are entitled to qualify and take their seats as Members of the United States Senate, the terms of their appointed predecessors nonetheless expire on the day of election.