For starters, unless you bragged on the internet or directly to a Federal agent, how would anyone know you bought it with the intent of selling it later??
And, its the later part that is the key, generally. Along with what is considered reasonable...."I'm gonna buy this, try it, and if I don't like it, sell it" is generally NOT even remotely considered "engaged in the business". Generally.
Despite current efforts to have the Executive branch redefine the law, what CONGRESS has put into law is fairly clear to most of us, and a single instance of buying and selling isn't even close to meeting that definition.
Under current usage, its not a "straw buy" unless you are buying the gun for someone who legally cannot, or you are buying it with someone else's money.
(as I understand it. Legal eagles, please correct me if I'm wrong)
I have heard of "stings" where someone buys a gun at a show, and while walking around with it, is approached by someone (undercover) and offered more than they paid (maybe a couple hundred bucks more) and then arrested when they sold the gun, for "dealing without a license".
I have not heard of any of these cases resulting in convictions, but I suppose it could happen.
The main points that need to be proven are what your intent was before purchase, and if you are doing it on a regular enough basis that indicates you are deliberately doing it for the income generated.
A friend of mine bought one of the mini GLocks in .45 on Friday. Took it to the range on Saturday. Hated it, and "sold" it back to the dealer on Monday.
Not even remotely a violation of law, that any of us could see.
Now, if you buy six identical pistols, then sell them because you "don't like them", then turn around and buy six more of the same thing the next week or month, that sends a much different signal.
In the situation you described, I don't see anything to worry about, unless you are buying, then selling multiple copies of the rifle. That would be fairly clear intent you are doing it to make a profit, which is different from making a profit as a result of doing it.
Not a lawyer, my advice is worth what you paid for it, no more, and possibly less.