Umm...in most scenarios A1 is an offensive player so B1 wouldn't be shooting since it would have been a TC foul.
But since I'm guessing that wasn't your intent 😉...B1 would shoot 1-and-1 with no one on the lane then the next Team B player who was fouled would shoot 1-and-1 with people on the lane. The foul against A2 counts.
In your second scenario, you have until the ball is at the disposal of Team A following B2's field goal to correct the error. If you catch it in time, the goal by B2 would count, you would shoot B1's 1-and-1 with no one on the lane and then you would go to the POI, which would be Team A allowed to run the end line after B2's field goal.