This is a very strange and inconsistent issue that I'm not sure I will explain properly, but I'll take it from the top:
When putting "player BOTNAME spawn in survival" or even "execute unless entity BOTNAME run player BOTNAME spawn in survival" into a repeating command block, the expected behavior is that actions related to spawning the bot will only occur once to spawn the bot.
However, it seems that it inconsistently will show two or multiple join messages instead of just one, and another issue is caused as a result of whatever repeated actions are taking place in the code.
After this multi-join msg happens, commands such as "execute at BOTNAME run particle minecraft:composter ~ ~1 ~ 0.3 0.5 0.3 10 20 force" will run properly when done in chat or by a command block, but when the same command is run through an advancement's reward function as "particle minecraft:composter ~ ~1 ~ 0.3 0.5 0.3 10 20 force", its position is that of the repeating command block (in other words the original spawning location)
From my testing, other commands like /tag or /playsound also do not work at the correct position or at all but ONLY when run by an advancement after being "double-summoned", otherwise they function as intended. To clarify, If the bot isn't "double-summoned," advancement reward functions do work properly, it only bugs out under that specific circumstance based on my testing.
This is a very strange and inconsistent issue that I'm not sure I will explain properly, but I'll take it from the top:
When putting "player BOTNAME spawn in survival" or even "execute unless entity BOTNAME run player BOTNAME spawn in survival" into a repeating command block, the expected behavior is that actions related to spawning the bot will only occur once to spawn the bot.
However, it seems that it inconsistently will show two or multiple join messages instead of just one, and another issue is caused as a result of whatever repeated actions are taking place in the code.
After this multi-join msg happens, commands such as "execute at BOTNAME run particle minecraft:composter ~ ~1 ~ 0.3 0.5 0.3 10 20 force" will run properly when done in chat or by a command block, but when the same command is run through an advancement's reward function as "particle minecraft:composter ~ ~1 ~ 0.3 0.5 0.3 10 20 force", its position is that of the repeating command block (in other words the original spawning location)
From my testing, other commands like /tag or /playsound also do not work at the correct position or at all but ONLY when run by an advancement after being "double-summoned", otherwise they function as intended. To clarify, If the bot isn't "double-summoned," advancement reward functions do work properly, it only bugs out under that specific circumstance based on my testing.
Here's a recording of this bug happening with the below function and advancement: https://www.youtube.com/watch?v=fpd-QDpreqY
Whether or not the only issue is with advancements isn't something I'm sure of, but it is the one that has been getting in my way so far.