That he took oath of allegiance to the Messenger of Allah ﷺ under the tree. The Messenger of Allah ﷺ said: If anyone swears by religion other than Islam falsely, he is like what has has said. If anyone kills himself with something, he will be punished with it on the Day of Resurrection. A vow over which a man has no control is not binding on him.
أَخْبَرَهُ أَنَّهُ بَايَعَ رَسُولَ اللَّهِ ﷺ تَحْتَ الشَّجَرَةِ أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ مَنْ حَلَفَ بِمِلَّةٍ غَيْرِ مِلَّةِ الإِسْلاَمِ كَاذِبًا فَهُوَ كَمَا قَالَ وَمَنْ قَتَلَ نَفْسَهُ بِشَىْءٍ عُذِّبَ بِهِ يَوْمَ الْقِيَامَةِ وَلَيْسَ عَلَى رَجُلٍ نَذْرٌ فِيمَا لاَ يَمْلِكُهُ