commands in a function not running

so I'm updating/revamping an old pack of mine and I have come across a bug that I can't figure out execute as @s at @s store result score @s banana.currentxp run xp query @s points execute as @s at @s if score @s banana.currentxp >= banana.xp banana.ten run function dsn-xpbottles:removexp execute as @s at @s store result score @s banana.currentxplevel run xp query @s levels execute as @s at @s if score @s banana.currentxplevel > banana.xp banana.zero if score @s banana.currentxp >= banana.xp banana.three run function dsn-xpbottles:removexp so in my pack when the player crouches on a brewing stand I have a function run and that all works just fine, it checks the player's current xp and saves it to a scoreboard, I then run a command to compare it to a set value and if it comes out true it runs a further function, it's running 100% fine untell I reload, it just stops working. when I reload I am setting the constant values and reseting the player's xp scores. I know the function is running because it updates the 0xp to the current xp level but it skips over the scoreboard comparing commands. It starts working properly when I update the player's xp by throwing an xp bottle and collecting the orbs. I hope this is enough info and that it is understandable, thanks for any help I can get
Continue to help post