That still would have been a bad shot.
There were18 seconds left on the shot clock and 22 seconds on the game clock and you're up by one point.
You're supposed to get inside quick and get up a good two point shot to go up one, or run the clock down first and then you take a three to go up by two, which would give the other team less time to put up a good two point shot on the other end to tie, and an even worse opportunity to put up a three point shot and win
Either way it goes you're supposed to run down the clock. Poor time management from an overrated player.