I am not 100% sure if it is related to appw profiles, but I would advise anyone to keep an eye on /var/nssynclog/sync_batch_status.log. I have seen errors in that log file resulting in config loss even though GUI claimed sync was successful.
exec: add appfw profile X
ERROR: Operation timed out
exec: add appfw profile X
ERROR: The remote side closed the connection.
exec: add appfw profile X
ERROR: Not logged in
Then the rest of the commands would fail with the same "Error: Not logged in"-error. Removing the allegedly problematic appfw profile seems to fix it - but it does not always happen. Sometimes it works without problems.