The issue is that you perform the exit check (player or boss HP drops below 0) before damage is even dealt. So if the game should be over because the boss died, it does not end, but a new round starts, and only then do you set the gameOn to False, but you've already started the next iteration.
One solution to this is to perform this check at the end of the loop.
I've also recommend doing the information printing just once in a loop, not multiple times.
And one more recommendation: HP == 0 should also count as death, which is not what you do right now (you check below 0 only).
Another issue I found is that if you check player death and boss death at the same time, then it is possible that the player has killed the boss, yet the dead boss still deals damage (potentially can kill the player and both of them could die).
A fix for this would be to check HP after damage is dealt separately for the boss and the player and break the loop when this happens. Otherwise, continue playing infinitely.
I've added these changes to your code below:
from random import randint
from time import sleep
'''
variables
'''
a = "choose what to do(1:attack, 2:heal, 3:shield) "
choice = 0
bosssHp = 100
playerHp = 100
isShielding = False
'''
function
'''
def inform():
print('the boss is at', bosssHp, 'hp')
print('you are at', playerHp, 'hp')
'''
main
'''
print ('Text Boss Game')
while True:
choice = int(input(a))
if choice == 1:
attackDamage = randint(10,30)
bosssHp -= attackDamage
print('you dealt ', attackDamage, ' damage ')
if bosssHp <= 0:
break
elif choice == 2:
healedHp = randint(5,150)
playerHp += healedHp
print('you healed ', healedHp, ' hp')
elif choice == 3:
isShielding = True
print('__________________________________')
sleep(1)
if isShielding is False:
recievedDamage = randint(10,25)
print('the boss dealt ', recievedDamage, ' damage')
playerHp -= recievedDamage
if playerHp <= 0:
break
isShielding = False
print('__________________________________')
sleep(2)
inform();
inform();
if playerHp < 0:
print('YOU LOSE')
if bosssHp < 0:
print('YOU WIN')