Sometimes profile properties have a different name in the browser.... sometimes the user name needs to be slightly different. Here's how I troubleshoot. Drag the data connection query and data fields to your form, so you can see the data being returned, and so you have the option to try different values in the query field. Add a button that runs the query (so you can try different queries and see what works!), and add another button that sets the query field to the userName() function - so you can see what the result of that is. Publish the form, and then you can see what's being returned initially in the query, as well as try setting it to the userName() function (with your test button) and executing the query (with your other test button). Maybe the userName() is including claims info and you need it not to (you can substring that out, need be) but at least this way you can see what's happening. :)
Hilary Stoupa
