So Peter in Acts 2:38, saying be baptized in the name of Jesus Christ for the remission of sins was wrong?
No. Peter telling the Jews that had crucified Jesus in unbelief to repent which means repenting from unbelief by believing in Him is how they really received the remission of sins same as the Gentiles did.
Also, the devils that believe that Jesus is the son of God have remission of sins?
That is not exactly what James had said nor what he was talking about. The church was disrespecting the poor as James was rebuking at the beginning of chapter 2 and the church was verbalizing their faith in God's Providence to the poor after church service in getting out of helping the poor from the bounty collected at church service. So James reference to them believing in God in pointing out the devils also believe in God & tremble was to point out their belief in God's Providence was dead in the eyes of the poor as the church's faith will not profit the poor nor save the poor seeing how the church hardly leads by example of the church's so called professed faith in God to provide.
James 2:14 What doth it profit, my brethren, though a man say he hath faith, and have not works? can faith save him? 15 If a brother or sister be naked, and destitute of daily food, 16 And one of you say unto them, Depart in peace, be ye warmed and filled; notwithstanding ye give them not those things which are needful to the body; what doth it profit? 17 Even so faith, if it hath not works, is dead, being alone. 18 Yea, a man may say, Thou hast faith, and I have works: shew me thy faith without thy works, and I will shew thee my faith by my works. 19 Thou believest that there is one God; thou doest well: the devils also believe, and tremble. 20 But wilt thou know, O vain man, that faith without works is dead? 21 Was not Abraham our father justified by works, when he had offered Isaac his son upon the altar? 22 Seest thou how faith wrought with his works, and by works was faith made perfect? 23 And the scripture was fulfilled which saith, Abraham believed God, and it was imputed unto him for righteousness: and he was called the Friend of God. 24 Ye see then how that by works a man is justified, and not by faith only.
James referenced Abraham in regards to the offering up of Isaac as that story is well known to Jews that it was about faith in God providing.
Genesis 22:7 And Isaac spake unto Abraham his father, and said, My father: and he said, Here am I, my son. And he said, Behold the fire and the wood: but where is the lamb for a burnt offering? 8 And Abraham said, My son, God will provide himself a lamb for a burnt offering: so they went both of them together.
13 And Abraham lifted up his eyes, and looked, and behold behind him a ram caught in a thicket by his horns: and Abraham went and took the ram, and offered him up for a burnt offering in the stead of his son. 14
And Abraham called the name of that place Jehovahjireh: as it is said to this day, In the mount of the Lord it shall be seen.
The name of the place proves what faith that needs works that James was referencing Abraham and Isaac for. So the church that voice faith in God's providence should do so by leading by example to the poor so the poor can see the church's faith to profit the poor & save the poor.
So James was never talking about the faith in Jesus Christ for salvation because it is without works. It is faith in God's Providence when sharing that faith to others, that it needs to be led by example.
Or, should one that believes in Jesus immediately be baptized for the remission of their sins?
Ephesians 2:8 For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: 9 Not of works, lest any man should boast.
If we had to get water baptized also for us to obtain salvation, then how can that be without works on our part?