41 When Solomon was told that Shimei had gone from Jerusalem to Gath and had returned, 42 the king summoned Shimei and said to him, “Did I not make you swear by the Lord and warn you, ‘On the day you leave to go anywhere else, you can be sure you will die’? At that time you said to me, ‘What you say is good. I will obey.’ 43 Why then did you not keep your oath to the Lord and obey the command I gave you?”
1 Kings 2:41-43
Some background might be helpful here. Returning to 2 Samuel 16 we read
5 As King David approached Bahurim, a man from the same clan as Saul’s family came out from there. His name was Shimei son of Gera, and he cursed as he came out. 6 He pelted David and all the king’s officials with stones, though all the troops and the special guard were on David’s right and left. 7 As he cursed, Shimei said, “Get out, get out, you murderer, you scoundrel! 8 The Lord has repaid you for all the blood you shed in the household of Saul, in whose place you have reigned. The Lord has given the kingdom into the hands of your son Absalom. You have come to ruin because you are a murderer!”
2 Samuel 16:5-8
As a result David instructed Solomon in his final words before he died in 1 Kings 2 (earlier in this chapter)
8 “And remember, you have with you Shimei son of Gera, the Benjamite from Bahurim, who called down bitter curses on me the day I went to Mahanaim. When he came down to meet me at the Jordan, I swore to him by the Lord: ‘I will not put you to death by the sword.’ 9 But now, do not consider him innocent. You are a man of wisdom; you will know what to do to him. Bring his gray head down to the grave in blood.”
1 Kings 2:8-9
So Solomon first placed Shimei under a form of house arrest where he could not leave Jerusalem and threaten[ed] him with death if ever he should cross the brook Kidron. The valley of Kidron is mentioned as the eastern boundary of the city (Keil and Delitzsch Biblical Commentary on the OT). So in our verses today we read Did I not make you swear by the Lord and warn you, ‘On the day you leave to go anywhere else, you can be sure you will die’? At that time you said to me, ‘What you say is good. I will obey.’ That indeed did happen as verses 37-38 reveal.
37 The day you leave and cross the Kidron Valley, you can be sure you will die; your blood will be on your own head.”
38 Shimei answered the king, “What you say is good. Your servant will do as my lord the king has said.” And Shimei stayed in Jerusalem for a long time.
1 Kings 2:37-38
But he did not follow through for after 3 years he left Jerusalem and crossed the Kidron Valley to capture two runaway slaves. Then we have this interesting conclusion to the chapter.
44 The king also said to Shimei, “You know in your heart all the wrong you did to my father David. Now the Lord will repay you for your wrongdoing. 45 But King Solomon will be blessed, and David’s throne will remain secure before the Lord forever.”
46 Then the king gave the order to Benaiah son of Jehoiada, and he went out and struck Shimei down and he died.
The kingdom was now established in Solomon’s hands.
1 Kings 2:44-46
Bottom line in two parts. One – Shimei never repented for how he had wronged David and two – he violated an oath he had taken before God and disobeyed the restrictions he had agreed to knowing the consequences. And he suffered the consequences. We also have an opportunity to repent knowing Jesus has already paid the price for our sins in only we will accept His free gift of Grace given through His Father’s love for us.