As noted in the question, a 3-day and 40-day period can be found in the accounts of the Resurrection and in Jonah:
And the LORD appointed a great fish to swallow up Jonah. And Jonah was in the belly of the fish three days and three nights. (Jonah 1:17 ESV)
3 So Jonah arose and went to Nineveh, according to the word of the LORD. Now Nineveh was an exceedingly great city, three days' journey in breadth. 4 Jonah began to go into the city, going a day's journey. And he called out, “Yet forty days, and Nineveh shall be overthrown!” (Jonah 3)
Jonah includes two 3-day periods and one of 40-days. Two were fulfilled immediately: Jonah was in the belly of the great fish for three days and three nights and it took Jonah three days to proclaim the message.
1The 40-day period was fulfilled in an unexpected way when "nothing" happened. In actuality, after 40-days, the sign of the LORD's mercy was given:
6 The LORD passed before him and proclaimed, “The LORD, the LORD, a God merciful and gracious, slow to anger, and abounding in steadfast love and faithfulness, 7 keeping steadfast love for thousands, forgiving iniquity and transgression and sin, but who will by no means clear the guilty, visiting the iniquity of the fathers on the children and the children's children, to the third and the fourth generation.” (Exodus 34)
When Nineveh made a heartfelt response to the message, the LORD responded by demonstrating His character: He forgave their iniquity, transgression, and sin (cf. Jonah 3:6-10). Nevertheless, when they returned to their evil ways, the disaster Jonah foretold took place and so all of what the LORD spoke to Moses about His character was fulfilled.
It must be noted Matthew states it was some of the scribes and Pharisees who asked for a sign, a request which Jesus immediately applied to an entire generation:
38 Then some of the scribes and Pharisees answered him, saying, “Teacher, we wish to see a sign from you.” 39 But he answered them, “An evil and adulterous generation seeks for a sign, but no sign will be given to it except the sign of the prophet Jonah. 40 For just as Jonah was three days and three nights in the belly of the great fish, so will the Son of Man be three days and three nights in the heart of the earth. 41 The men of Nineveh will rise up at the judgment with this generation and condemn it, for they repented at the preaching of Jonah, and behold, something greater than Jonah is here. (Matthew 12)
First, Jesus is saying the sign would be the first 3-day (and 3-night) period found in Jonah. Next, while those who asked wanted to see a sign, Jesus' responded by saying the sign would be given, δίδωμι, which means to give to someone, to grant, furnish, or supply. It is a stretch to claim this meant He would show them the sign. Finally, if Jesus' response was taken literally, as the OP suggests it must, then the sign would have to be shown to everyone of that generation, not just those few who asked.
Matthew later calls attention to the sign before it was fulfilled:
62 The next day, that is, after the day of Preparation, the chief priests and the Pharisees gathered before Pilate 63 and said, “Sir, we remember how that impostor said, while he was still alive, ‘After three days I will rise.’ 64 Therefore order the tomb to be made secure until the third day, lest his disciples go and steal him away and tell the people, ‘He has risen from the dead,’ and the last fraud will be worse than the first.” (Matthew 27)
The sign was the period of time Jesus spent in the tomb, not the subsequent resurrection. Even if Jesus personally appeared to everyone who asked for the sign, that would not be evidence of the sign they asked to see. For example, suppose Jesus showed himself as he did to His disciples. A scribe or Pharisee could ask, "how do I know you were in the tomb for 3-days and 3-nights?" The burden to see the period of time Jesus spent in the tomb was on those who made the request, not on Jesus. In fact, if one of those who requested the sign had waited outside the tomb, they would seen it, or they would have seen Jesus come out in less than 3-days and 3-nights and rightly conclude He failed to give the correct sign.
The Resurrection is independent of the time spent in the tomb. If those who asked for a sign wanted to see it, they needed to watch the tomb to verify the amount of time Jesus would spend before coming out. Obviously, it was impossible for Jesus to show them how long He was in the tomb. The visible proof of 3-days and 3-nights could only be seen by someone watching from the outside, a reality those who asked were aware of, but failed to do. The failure to see the sign Jesus promised was theirs, not His.
Moreover, Jesus did fulfill His part when He ensured the New Testament writers recorded the sign for the entire generation. And if the length of time is in dispute, it would be nonsensical to believe in the Resurrection and yet fail to accept the fact of the Resurrection as a fulfillment of the sign on the basis those who requested it failed to do their part.
1. Presumably the size of Nineveh, 3-days journey, which omits any reference to nights, means Jonah preached only during the day and the elapsed time from start to finish would have been 3-days and 2-nights. In order to start "on time" Jonah would have to be in Nineveh at the start of the day which implies he was there the night before. In this case the total time would be 3-nights and 3-days, the same duration he spent in the great fish.