Where is that script executed? If it’s on your level BP’s Begin Play, and the script that changes your static meshes is in their own Blueprints, then your Level BP script might be executed before the static mesh Blueprint’s begin play is.
Try adding a 0.1 second delay to the script that gets all your meshes and prints their names and see if its still the old name.
edit: To be honest you should just add the print string logic in the blueprint that holds your static meshes, right after you change the static mesh, that way you circumvent this issue entirely. There’s no point getting all the meshes in your level and then getting their components etc, when you can just have the meshes themselves print their own name.