"Can the $400 be taxable instead of the $1000 since i incurred a loss and was sold on the same day?"
Yes.
Any gains and losses can be offset at the financial year that occurred during that FY.
Any losses from previous FY's can be carried forward indefinitely and be offset against future gains.