The sender profile is processed out of step with the email. Meaning anything set or declared in email will not transfer to sender profile. So those variables will be null in sender profile.
You will need to either put the ampscript directly into the inputs in the sender profile inputs in the sender profile, reference a content block with the ampscript in it or have it included inside the sendable data and put the correlating attributestring inside the sender profile input.